Package org.jppf.utils.configuration
Class AbstractJPPFProperty<T>
java.lang.Object
org.jppf.utils.configuration.AbstractJPPFProperty<T>
- Type Parameters:
T- the type of the value of this property.
- All Implemented Interfaces:
Serializable,JPPFProperty<T>
- Direct Known Subclasses:
BooleanProperty,CharProperty,FileProperty,IntArrayProperty,NumberProperty,StringArrayProperty,StringProperty
Abstract implementation of the
JPPFProperty interface.- Since:
- 5.2
- Author:
- Laurent Cohen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractJPPFProperty(String name, T defaultValue, String... aliases) Initialize this property with the specified name and default value. -
Method Summary
Modifier and TypeMethodDescriptionString[]Get the aliases for this property, that is, other names it may be known as such as legacy names from prior versions.Get the default value of this property.Get a string explaining why a property was deprecated and/or what to use instead.getDeprecatedDoc(Locale locale) Get a string explaining why a property was deprecated and/or what to use instead.Get a description of this property.getDocumentation(Locale locale) Get a description of this property.getName()Get the name of this property.getParameterDoc(String param) Get the documeentation for the specified parmaeter, if it exists.String[]Get the parmaeters specified in the name of property, if any.T[]Get the possible values for this property, if any is defined.Get a short label for this property.getShortLabel(Locale locale) Get a short label for this property.getTags()Get the set of tags that apply to this property.booleanDetermine whether this property is deprecated.resolveName(String... params) Resolve the name of the property by substituting the parameters names with actual values.resolveName(String alias, String... params) Resolve the specified alias for the property's name by substituting the parameters names with actual values.setDeprecated(boolean deprecated) Specify whether this property is deprecated.voidsetI18nBase(String i18nBase) Set the location of the localization resource bundles.setPossibleValues(T... possibleValues) Set the possible values for this property.toString()Convert the specified value to a string.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.utils.configuration.JPPFProperty
valueOf, valueType
-
Constructor Details
-
AbstractJPPFProperty
Initialize this property with the specified name and default value.- Parameters:
name- the name of this property.defaultValue- the default value of this property, used when the proeprty is not defined.aliases- other names that may be given to this property (e.g. older names from previous versions).
-
-
Method Details
-
getName
Description copied from interface:JPPFPropertyGet the name of this property.- Specified by:
getNamein interfaceJPPFProperty<T>- Returns:
- the property's name.
-
getDefaultValue
Description copied from interface:JPPFPropertyGet the default value of this property.- Specified by:
getDefaultValuein interfaceJPPFProperty<T>- Returns:
- the default value;
-
getAliases
Description copied from interface:JPPFPropertyGet the aliases for this property, that is, other names it may be known as such as legacy names from prior versions.- Specified by:
getAliasesin interfaceJPPFProperty<T>- Returns:
- an array of the aliases for this property, possibly empty.
-
toString
Description copied from interface:JPPFPropertyConvert the specified value to a string.- Specified by:
toStringin interfaceJPPFProperty<T>- Parameters:
value- the property value to convert.- Returns:
- a String representation of the value.
-
toString
-
getPossibleValues
Get the possible values for this property, if any is defined.- Returns:
- an array of the possible values.
-
setPossibleValues
Set the possible values for this property.- Parameters:
possibleValues- an array of the possible values.- Returns:
- this property.
-
getDocumentation
Description copied from interface:JPPFPropertyGet a description of this property.- Specified by:
getDocumentationin interfaceJPPFProperty<T>- Returns:
- the description as a string.
-
getDocumentation
Description copied from interface:JPPFPropertyGet a description of this property.- Specified by:
getDocumentationin interfaceJPPFProperty<T>- Parameters:
locale- the locale in which the documentation of this property should be returned.- Returns:
- the description as a string.
-
getShortLabel
Description copied from interface:JPPFPropertyGet a short label for this property.- Specified by:
getShortLabelin interfaceJPPFProperty<T>- Returns:
- the label as a string.
-
getShortLabel
Description copied from interface:JPPFPropertyGet a short label for this property.- Specified by:
getShortLabelin interfaceJPPFProperty<T>- Parameters:
locale- the locale in which the short label of this property should be returned.- Returns:
- the label as a string.
-
getTags
Description copied from interface:JPPFPropertyGet the set of tags that apply to this property.- Specified by:
getTagsin interfaceJPPFProperty<T>- Returns:
- a set of tags as strings.
-
getParameters
Description copied from interface:JPPFPropertyGet the parmaeters specified in the name of property, if any. Parameters are specified as in this example:my.<param1>.property.<param2>.name = some value.- Specified by:
getParametersin interfaceJPPFProperty<T>- Returns:
- an array of the parameter names, empty if there is no parameter.
-
getParameterDoc
Description copied from interface:JPPFPropertyGet the documeentation for the specified parmaeter, if it exists.- Specified by:
getParameterDocin interfaceJPPFProperty<T>- Parameters:
param- the name of the parameter for which to find a description.- Returns:
- a string describing the parameter.
-
resolveName
Description copied from interface:JPPFPropertyResolve the name of the property by substituting the parameters names with actual values.- Specified by:
resolveNamein interfaceJPPFProperty<T>- Parameters:
params- the values of the parameters.- Returns:
- the new resolve name.
-
resolveName
Description copied from interface:JPPFPropertyResolve the specified alias for the property's name by substituting the parameters names with actual values.- Specified by:
resolveNamein interfaceJPPFProperty<T>- Parameters:
alias- the alias to resolve.params- the values of the parameters.- Returns:
- the new resolve name.
-
getI18nBase
- Returns:
- the location of the localization resource bundles.
-
setI18nBase
Set the location of the localization resource bundles.- Parameters:
i18nBase- the location to set.
-
isDeprecated
public boolean isDeprecated()Description copied from interface:JPPFPropertyDetermine whether this property is deprecated.- Specified by:
isDeprecatedin interfaceJPPFProperty<T>- Returns:
trueif the property is deprecated,falseotherwise.
-
setDeprecated
Description copied from interface:JPPFPropertySpecify whether this property is deprecated.- Specified by:
setDeprecatedin interfaceJPPFProperty<T>- Parameters:
deprecated-trueif the property is deprecated,falseotherwise.- Returns:
- this property, for method call chaining.
-
getDeprecatedDoc
Description copied from interface:JPPFPropertyGet a string explaining why a property was deprecated and/or what to use instead.- Specified by:
getDeprecatedDocin interfaceJPPFProperty<T>- Returns:
- a text documentation about this property's deprecation.
-
getDeprecatedDoc
Description copied from interface:JPPFPropertyGet a string explaining why a property was deprecated and/or what to use instead.- Specified by:
getDeprecatedDocin interfaceJPPFProperty<T>- Parameters:
locale- the locale in which the text should be returned.- Returns:
- a text documentation about this property's deprecation.
-