de.smartics.properties.spi.core.metadata
Class PropertyMetaData

Package class diagram package PropertyMetaData
java.lang.Object
  extended by de.smartics.properties.spi.core.metadata.PropertyMetaData
All Implemented Interfaces:
PropertyDescriptor, Serializable

public final class PropertyMetaData
     
     
extends Object
implements PropertyDescriptor

An implementation of the property descriptor interface that allows to set property meta data.

See Also:
Serialized Form

Nested Class Summary
static class PropertyMetaData.Builder
          Creates instances of type PropertyMetaData.
 
Method Summary
 AccessType getAccessType()
          Returns the flag to define the access type.
 PropertyCategories getCategories()
          Returns the categories this property is associated with.
 PropertyComment getComment()
          Returns the comment to the property and its values.
 PropertyComment getComment(Locale locale)
          Returns the comment to the property and its values.
 PropertyDefinitionTime getConfigurationTime()
          The designed time the property is defined.
 List<? extends PropertyConstraint<?>> getConstraints()
          Returns a list of constraints a value for the property has to meet.
 PropertyContext getContext()
          Returns the context of the property descriptor.
 Class<?> getDeclaringType()
          Returns the type that declares the property that is described by this instance.
 PropertyExpression getDefaultExpression()
          Returns the expression to use to construct the value of the property.
 PropertyProjectdoc getDocumentMetaData()
          Returns the meta data information for the property.
 PropertyProjectdoc getDocumentMetaData(Locale locale)
          Returns the meta data information for the property.
 PropertySetProjectdoc getDocumentMetaDataProjectSet()
          Returns the meta data information for the property set.
 PropertySetProjectdoc getDocumentMetaDataProjectSet(Locale locale)
          Returns the meta data information for the property set.
 DocumentName getDocumentName()
          Returns the name of the document that identifies the document uniquely within the context of the project.
 PropertyKey getKey()
          Returns the key of the property.
 PropertyType getType()
          Returns the type of the property value.
 long getUpdateIntervalInMs()
          Returns the update interval in milliseconds (ms).
 PropertyUse.UseType getUseType()
          Returns the use type of the property.
 PropertyValueRange<?> getValueRange()
          Returns the range of values allowed for this property.
 boolean isMandatory()
          Checks if the property is mandatory to be not null.
 boolean isRuntimeMutable()
          Checks whether or not the property is mutable at runtime.
 boolean isSecured()
          Returns the flag to determine whether or not the property value contains sensitive information that is required to be secured.
 String toString()
          Returns the string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getContext

public PropertyContext getContext()
Description copied from interface: PropertyDescriptor
Returns the context of the property descriptor.

Specified by:
getContext in interface PropertyDescriptor
Returns:
the context of the property descriptor.

getDeclaringType

public Class<?> getDeclaringType()
Description copied from interface: PropertyDescriptor
Returns the type that declares the property that is described by this instance.

Specified by:
getDeclaringType in interface PropertyDescriptor
Returns:
the declaring type of the property this instance is the descriptor for.

getKey

public PropertyKey getKey()
Description copied from interface: PropertyDescriptor
Returns the key of the property.

This value must not be null.

Specified by:
getKey in interface PropertyDescriptor
Returns:
the name of the component the property belongs to.

getType

public PropertyType getType()
Description copied from interface: PropertyDescriptor
Returns the type of the property value.

This value must not be null.

If there is no value range specified for the property type, the type is either required to specify a static fromString method or is a standard or registered type whose conversion rules are well known.

 public static T fromString(String value);
 

Specified by:
getType in interface PropertyDescriptor
Returns:
the type of the property value.

isMandatory

public boolean isMandatory()
Description copied from interface: PropertyDescriptor
Checks if the property is mandatory to be not null. If the property is not mandatory, it is optional.

Specified by:
isMandatory in interface PropertyDescriptor
Returns:
true if the property is mandatory to be not null, false otherwise.

isSecured

public boolean isSecured()
Returns the flag to determine whether or not the property value contains sensitive information that is required to be secured.

Specified by:
isSecured in interface PropertyDescriptor
Returns:
the flag to determine whether or not the property value contains sensitive information that is required to be secured.

getAccessType

public AccessType getAccessType()
Description copied from interface: PropertyDescriptor
Returns the flag to define the access type.

Specified by:
getAccessType in interface PropertyDescriptor
Returns:
the flag to define the access type.

isRuntimeMutable

public boolean isRuntimeMutable()
Description copied from interface: PropertyDescriptor
Checks whether or not the property is mutable at runtime.

Specified by:
isRuntimeMutable in interface PropertyDescriptor
Returns:
true if the property may be changed after startup, false if the property value is immutable (that is: stays the same) after startup.
See Also:
PropertyDescriptor.getUpdateIntervalInMs()

getUpdateIntervalInMs

public long getUpdateIntervalInMs()
Description copied from interface: PropertyDescriptor
Returns the update interval in milliseconds (ms).

An application may cache the value of the property for the given period of time.

 
     
     
value description
< 0 Property is not mutable.
0 Property is read on each access.
> 0 Property is required to be read new after the given number of ms elapsed. In the meantime a previously read cached value is returned.

The constants defined in PropertyLifecycle.UpdateInterval provide constants to define intervals.

Specified by:
getUpdateIntervalInMs in interface PropertyDescriptor
Returns:
the update interval in milliseconds (ms).

getConfigurationTime

public PropertyDefinitionTime getConfigurationTime()
Description copied from interface: PropertyDescriptor
The designed time the property is defined.

This value must not be null.

Specified by:
getConfigurationTime in interface PropertyDescriptor
Returns:
the designed time the property is defined.

getDefaultExpression

public PropertyExpression getDefaultExpression()
Description copied from interface: PropertyDescriptor
Returns the expression to use to construct the value of the property. An expression may reference another property or may serve as a template containing any number of property references.

Resolving fails if at least one property reference cannot be resolved.

Example:

$ server
/path/${command}}

Specified by:
getDefaultExpression in interface PropertyDescriptor
Returns:
the value of the expression. May be null.

getValueRange

public PropertyValueRange<?> getValueRange()
Description copied from interface: PropertyDescriptor
Returns the range of values allowed for this property.

The returned value may be null if there is no specific range of values the value of the property has to be part of. For instance a property may have no value range or only value ranges that are not enumerable. The latter may only be modeled by a property constraint.

Specified by:
getValueRange in interface PropertyDescriptor
Returns:
the range for values allowed for this property. May be null.

getConstraints

public List<? extends PropertyConstraint<?>> getConstraints()
Description copied from interface: PropertyDescriptor
Returns a list of constraints a value for the property has to meet.

Specified by:
getConstraints in interface PropertyDescriptor
Returns:
a list of constraints a value for the property has to meet. The list may be empty, but is never null.

getDocumentName

public DocumentName getDocumentName()
Description copied from interface: PropertyDescriptor
Returns the name of the document that identifies the document uniquely within the context of the project. It is used to select the projectdoc document in the META-INF folder.

Specified by:
getDocumentName in interface PropertyDescriptor
Returns:
the name of the document that identifies the document uniquely within the context of the project.

getDocumentMetaData

public PropertyProjectdoc getDocumentMetaData()
Description copied from interface: PropertyDescriptor
Returns the meta data information for the property.

This value must not be null.

Specified by:
getDocumentMetaData in interface PropertyDescriptor
Returns:
the meta data information for the property.

getDocumentMetaData

public PropertyProjectdoc getDocumentMetaData(Locale locale)
Description copied from interface: PropertyDescriptor
Returns the meta data information for the property.

This value must not be null.

Specified by:
getDocumentMetaData in interface PropertyDescriptor
Parameters:
locale - the locale to determine which bundle to use.
Returns:
the meta data information for the property.

getDocumentMetaDataProjectSet

public PropertySetProjectdoc getDocumentMetaDataProjectSet()
Description copied from interface: PropertyDescriptor
Returns the meta data information for the property set.

This value must not be null.

Specified by:
getDocumentMetaDataProjectSet in interface PropertyDescriptor
Returns:
the meta data information for the property set.

getDocumentMetaDataProjectSet

public PropertySetProjectdoc getDocumentMetaDataProjectSet(Locale locale)
Description copied from interface: PropertyDescriptor
Returns the meta data information for the property set.

This value must not be null.

Specified by:
getDocumentMetaDataProjectSet in interface PropertyDescriptor
Parameters:
locale - the locale to determine which bundle to use.
Returns:
the meta data information for the property set.

getComment

public PropertyComment getComment()
Description copied from interface: PropertyDescriptor
Returns the comment to the property and its values.

This value must not be null.

Specified by:
getComment in interface PropertyDescriptor
Returns:
the comment to the property and its values.

getComment

public PropertyComment getComment(Locale locale)
Description copied from interface: PropertyDescriptor
Returns the comment to the property and its values.

This value must not be null.

Specified by:
getComment in interface PropertyDescriptor
Parameters:
locale - the locale to determine which bundle to use.
Returns:
the comment to the property and its values.

getCategories

public PropertyCategories getCategories()
Description copied from interface: PropertyDescriptor
Returns the categories this property is associated with.

Specified by:
getCategories in interface PropertyDescriptor
Returns:
the categories this property is associated with.

getUseType

public PropertyUse.UseType getUseType()
Returns the use type of the property.

Specified by:
getUseType in interface PropertyDescriptor
Returns:
the use type of the property.

toString

public String toString()
Returns the string representation of the object.

Overrides:
toString in class Object
Returns:
the string representation of the object.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.