com.talk2object.plum.interaction.view.annotation.parameter.helper.AbstractParameterWrapper Maven / Gradle / Ivy
package com.talk2object.plum.interaction.view.annotation.parameter.helper;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.List;
import com.talk2object.plum.interaction.rich.field.InteractiveField;
import com.talk2object.plum.interaction.rich.field.StringField;
public abstract class AbstractParameterWrapper implements ParameterWrapper {
protected Annotation parameter;
protected Class targetClass;
@Override
public void setParameter(Annotation parameter) {
this.parameter = parameter;
}
@Override
public void setTargetClass(Class targetClass) {
this.targetClass = targetClass;
}
/**
* direct value from annotation
*
* @return
*/
abstract Object getInitValue();
/**
* direct value from annotation
*
* @return
*/
abstract Object[] getOptionValues();
@Override
public boolean hasOptions() {
return getOptionValues().length > 0;
}
@Override
public Object value2Object(Object value) {
// same as annotation type
return value;
}
@Override
public Object getInitValueAsObject() {
return value2Object(getInitValue());
}
@Override
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy