Class DynamicSTProperties
java.lang.Object
it.uniroma2.art.semanticturkey.properties.dynamic.DynamicSTProperties
- All Implemented Interfaces:
STProperties
An
STProperties
which can be defined at runtime. Differently from ordinary STProperties
implementations that define their content as Java fields, this class allows to define the allowed
properties at runtime via an API.- Author:
- Manuel Fiorelli
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
static class
Nested classes/interfaces inherited from interface it.uniroma2.art.semanticturkey.properties.STProperties
STProperties.BasicPropertiesConstraints, STProperties.BasicPropertyConstraintValidator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
getAnnotations
(String id) Returns the annotations (if any) associated with the property with givenid
.getEnumeration
(String id) Returns the enumeration (if any) associated with the property with givenid
.An optional HTML description of this type of propertySetAn optional HTML warning related to this type of propertySetreturns all the properties of the class implementing this interface, which have been annotated asSTProperty
get the expected type of content for the property.protected org.apache.commons.lang3.tuple.Pair<DynamicSTProperties.PropertyDefinition,
Object> this method returns the description of a propertythis method returns the displayName of a property.gets the value of a property previously set on this set of propertiesboolean
tells if this set of properties needs to be explicitly set by the user or if it can be used in its default settingsboolean
void
removeProperty
(String id) void
setHtmlDescription
(String htmlDescription) void
setHtmlWarning
(String htmlWarning) void
setPropertyValue
(String id, Object value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface it.uniroma2.art.semanticturkey.properties.STProperties
checkAndConvertPropertyValue, convertToPropertValue, getPropertyType, getStringRepresentation, isEnumerated, loadProperties, setProperties, storeProperties, storeProperties
-
Constructor Details
-
DynamicSTProperties
-
DynamicSTProperties
public DynamicSTProperties()
-
-
Method Details
-
getPropertyDefinitionAndValue
protected org.apache.commons.lang3.tuple.Pair<DynamicSTProperties.PropertyDefinition,Object> getPropertyDefinitionAndValue(String id) throws PropertyNotFoundException - Throws:
PropertyNotFoundException
-
addProperty
-
removeProperty
-
getPropertyDefinition
public DynamicSTProperties.PropertyDefinition getPropertyDefinition(String id) throws PropertyNotFoundException - Throws:
PropertyNotFoundException
-
getShortName
- Specified by:
getShortName
in interfaceSTProperties
- Returns:
- a humanly understandable short name representing the type of this property set
-
setHtmlDescription
-
getHTMLDescription
Description copied from interface:STProperties
An optional HTML description of this type of propertySet- Specified by:
getHTMLDescription
in interfaceSTProperties
- Returns:
- an HTML description of this type of propertySet. It may be
null
, if no description is available
-
setHtmlWarning
-
getHTMLWarning
Description copied from interface:STProperties
An optional HTML warning related to this type of propertySet- Specified by:
getHTMLWarning
in interfaceSTProperties
- Returns:
- An optional HTML warning related to this type of propertySet. It may be
null
, if no warning is available
-
getProperties
Description copied from interface:STProperties
returns all the properties of the class implementing this interface, which have been annotated asSTProperty
- Specified by:
getProperties
in interfaceSTProperties
- Returns:
-
getPropertyAnnotatedType
- Specified by:
getPropertyAnnotatedType
in interfaceSTProperties
- Throws:
PropertyNotFoundException
-
getPropertyContentType
Description copied from interface:STProperties
get the expected type of content for the property. Can be used by external tools to drive the acquisition of that value or to check- Specified by:
getPropertyContentType
in interfaceSTProperties
- Returns:
- Throws:
PropertyNotFoundException
-
getPropertyDescription
Description copied from interface:STProperties
this method returns the description of a property- Specified by:
getPropertyDescription
in interfaceSTProperties
- Returns:
- Throws:
PropertyNotFoundException
-
getPropertyDisplayName
Description copied from interface:STProperties
this method returns the displayName of a property. If not provided, return the property name- Specified by:
getPropertyDisplayName
in interfaceSTProperties
- Returns:
- Throws:
PropertyNotFoundException
-
getEnumeration
Description copied from interface:STProperties
Returns the enumeration (if any) associated with the property with givenid
.- Specified by:
getEnumeration
in interfaceSTProperties
- Returns:
- Throws:
PropertyNotFoundException
-
getPropertyValue
Description copied from interface:STProperties
gets the value of a property previously set on this set of properties- Specified by:
getPropertyValue
in interfaceSTProperties
- Returns:
- Throws:
PropertyNotFoundException
-
setPropertyValue
- Specified by:
setPropertyValue
in interfaceSTProperties
- Throws:
WrongPropertiesException
-
isRequiredProperty
- Specified by:
isRequiredProperty
in interfaceSTProperties
- Throws:
PropertyNotFoundException
-
hasRequiredProperties
public boolean hasRequiredProperties()Description copied from interface:STProperties
tells if this set of properties needs to be explicitly set by the user or if it can be used in its default settings- Specified by:
hasRequiredProperties
in interfaceSTProperties
- Returns:
-
getAnnotations
Description copied from interface:STProperties
Returns the annotations (if any) associated with the property with givenid
.- Specified by:
getAnnotations
in interfaceSTProperties
- Returns:
- Throws:
PropertyNotFoundException
-