Package org.openbase.jps.core
Class AbstractJavaProperty<V>
- java.lang.Object
-
- org.openbase.jps.core.AbstractJavaProperty<V>
-
- Type Parameters:
V-
- All Implemented Interfaces:
Comparable<AbstractJavaProperty>
- Direct Known Subclasses:
AbstractJPBoolean,AbstractJPClass,AbstractJPDouble,AbstractJPEnum,AbstractJPFile,AbstractJPFloat,AbstractJPInteger,AbstractJPList,AbstractJPLong,AbstractJPMap,AbstractJPMethod,AbstractJPString,AbstractJPTime,JPHelp,JPLocale
public abstract class AbstractJavaProperty<V> extends Object implements Comparable<AbstractJavaProperty>
- Author:
- Divine Threepwood
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractJavaProperty.ValueType
-
Field Summary
Fields Modifier and Type Field Description protected String[]argumentIdentifiersprotected List<String>argumentsprotected Stringidentifierprotected org.slf4j.Loggerloggerprotected String[]propertyIdentifiers
-
Constructor Summary
Constructors Constructor Description AbstractJavaProperty(String[] propertyIdentifier)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddArgument(String arg)protected voidaddErrorReport(Exception exception, AbstractJavaProperty.ValueType valueType)protected voidcheckArgumentCount(int size)protected voidcheckArgumentCount(int min, int max)protected voidcheckArgumentCountMax(int max)protected voidcheckArgumentCountMin(int min)intcompareTo(AbstractJavaProperty o)protected abstract String[]generateArgumentIdentifiers()protected String[]getArgumentIdentifiers()StringgetDefaultExample()VgetDefaultValue()List<Class<? extends AbstractJavaProperty>>getDependencyList()Method returns a list with properties where this property depends on.abstract StringgetDescription()Method returns the description of the property.protected ExceptiongetErrorReport()protected Map<AbstractJavaProperty.ValueType,Exception>getErrorReportMap()protected StringgetOneArgumentResult()protected abstract VgetPropertyDefaultValue()protected String[]getPropertyIdentifiers()StringgetSyntax()VgetValue()AbstractJavaProperty.ValueTypegetValueType()protected booleanisIdentified()protected booleanisIdentifiered()Deprecated.please use isIdentified() insteadbooleanisParsed()protected voidloadAction()Can be overwritten for specific load action.protected booleanmatch(String commandIdentifier)protected booleanneetToBeParsed()protected voidoverwriteDefaultValue(V defaultValue)protected abstract Vparse(List<String> arguments)protected voidparseArguments()protected voidregisterDependingProperty(Class<? extends AbstractJavaProperty> dependency)protected voidreset()protected voidsetValue(V value, AbstractJavaProperty.ValueType valueType)StringtoString()voidupdate(V value)protected voidupdateValue()protected voidvalidate()Can be overwritten for value validation.
-
-
-
Constructor Detail
-
AbstractJavaProperty
public AbstractJavaProperty(String[] propertyIdentifier)
-
-
Method Detail
-
match
protected final boolean match(String commandIdentifier)
-
neetToBeParsed
protected final boolean neetToBeParsed()
-
reset
protected final void reset()
-
addArgument
protected final void addArgument(String arg)
-
parseArguments
protected final void parseArguments() throws JPParsingException- Throws:
JPParsingException
-
getValue
public final V getValue()
-
setValue
protected void setValue(V value, AbstractJavaProperty.ValueType valueType)
-
update
public final void update(V value)
-
updateValue
protected final void updateValue() throws JPServiceException- Throws:
JPServiceException
-
overwriteDefaultValue
protected final void overwriteDefaultValue(V defaultValue)
-
isIdentifiered
@Deprecated protected boolean isIdentifiered()
Deprecated.please use isIdentified() instead
-
isIdentified
protected final boolean isIdentified()
-
getDefaultValue
public final V getDefaultValue() throws JPNotAvailableException
- Throws:
JPNotAvailableException
-
generateArgumentIdentifiers
protected abstract String[] generateArgumentIdentifiers()
-
getPropertyIdentifiers
protected final String[] getPropertyIdentifiers()
-
getArgumentIdentifiers
protected final String[] getArgumentIdentifiers()
-
getDefaultExample
public String getDefaultExample()
-
getSyntax
public String getSyntax()
-
isParsed
public final boolean isParsed()
-
compareTo
public final int compareTo(AbstractJavaProperty o)
- Specified by:
compareToin interfaceComparable<V>
-
getOneArgumentResult
protected final String getOneArgumentResult() throws JPBadArgumentException
- Throws:
JPBadArgumentException
-
getValueType
public final AbstractJavaProperty.ValueType getValueType()
-
checkArgumentCount
protected final void checkArgumentCount(int size) throws JPBadArgumentException- Throws:
JPBadArgumentException
-
checkArgumentCountMin
protected final void checkArgumentCountMin(int min) throws JPBadArgumentException- Throws:
JPBadArgumentException
-
checkArgumentCountMax
protected final void checkArgumentCountMax(int max) throws JPBadArgumentException- Throws:
JPBadArgumentException
-
checkArgumentCount
protected final void checkArgumentCount(int min, int max) throws JPBadArgumentException- Throws:
JPBadArgumentException
-
addErrorReport
protected final void addErrorReport(Exception exception, AbstractJavaProperty.ValueType valueType)
-
getErrorReport
protected final Exception getErrorReport()
-
getErrorReportMap
protected final Map<AbstractJavaProperty.ValueType,Exception> getErrorReportMap()
-
validate
protected void validate() throws JPValidationExceptionCan be overwritten for value validation. Method is called after parsing.- Throws:
JPValidationException
-
loadAction
protected void loadAction()
Can be overwritten for specific load action. Method is called after loading a property instance.
-
getPropertyDefaultValue
protected abstract V getPropertyDefaultValue() throws JPNotAvailableException
- Throws:
JPNotAvailableException
-
getDependencyList
public final List<Class<? extends AbstractJavaProperty>> getDependencyList()
Method returns a list with properties where this property depends on.- Returns:
- a list of java properties.
-
registerDependingProperty
protected final void registerDependingProperty(Class<? extends AbstractJavaProperty> dependency)
-
getDescription
public abstract String getDescription()
Method returns the description of the property.
-
-