Package com.adobe.aem.dermis.model
Class Property
- java.lang.Object
-
- com.adobe.aem.dermis.model.AbstractAsset
-
- com.adobe.aem.dermis.model.TypedAsset
-
- com.adobe.aem.dermis.model.ConstraintAsset
-
- com.adobe.aem.dermis.model.Property
-
- All Implemented Interfaces:
IAsset
,IConstraintAsset
,IProperty
,ITypeAsset
,java.io.Serializable
- Direct Known Subclasses:
RestProperty
,WSProperty
public class Property extends ConstraintAsset implements IProperty
Represents a property and it's metadata description. Properties reside within a DataModel and can be used as keys for relationships between datamodels.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Property()
Property(java.lang.String name, PropertyType type, IDataModel dataModel)
Property(java.lang.String name, PropertyType type, IDataModel dataModel, java.lang.Boolean required)
Property(java.lang.String name, PropertyType type, IDataModel dataModel, java.lang.Boolean isPrimaryKey, java.lang.Boolean required)
Property(java.lang.String name, java.lang.String description, PropertyType type)
Property(java.lang.String name, java.lang.String description, PropertyType type, java.lang.String typeRef)
Property(java.lang.String title, java.lang.String name, java.lang.String description, PropertyType type, java.lang.String typeRef, PropertyType subType, java.lang.String subTypeRef)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAssociation(PropertyType associationType, IDataModel dataModel)
Add the associated datamodelIDataModel
getAssociatedDataModel()
Returns the data model associated with this property either One-To-One or One-To-ManyIDataModel
getChildDataModel()
Gets the associated data model.IDataModel
getDataModel()
Gets the datamodel for which this property belongjava.lang.Object[]
getEnumList()
Gets the enum related of this property.java.lang.String
getIdentifier()
Gets the identifier of this property.java.lang.Boolean
getIsPrimaryKey()
java.lang.String
getParameterType()
Gets the parameter type of this property.java.util.List<? extends IProperty>
getProperties()
Gets the properties of this property if property type is Array.java.lang.String
getReferenceName()
Returns the reference entity name.java.lang.Boolean
getRequired()
Determines whether or not this property accepts null values.IRule
getRules()
Returns the rules of the attribute.boolean
isArrayOfPrimitive()
Returns true, if attribute is array of primitive i.e.boolean
isBelowCollection()
Return true if property is part of collection entity.boolean
isComplexType()
Returns true if attribute is of type ARRAY or OBJECT.boolean
isComputed()
Determines if this property is a computed property.java.lang.Boolean
isMetadataKey()
Determines if this property is the metadata key(s) of its datamodel.boolean
isNullable()
Determines whether or not this property accepts null values.java.lang.Boolean
isPrimaryKey()
Determines if this property is (one of) the primary key(s) of its datamodel.boolean
isPrimitiveType()
Returns true if attribute is of primitive type.void
setChildDataModel(IDataModel childDataModel)
Sets the associated data model.void
setDataModel(IDataModel dataModel)
void
setEnumList(java.lang.Object[] enumList)
void
setIsPrimaryKey(java.lang.Boolean isPrimaryKey)
void
setNullable(boolean nullable)
void
setParameterType(java.lang.String parameterType)
void
setProperties(java.util.List<IProperty> properties)
void
setRequired(java.lang.Boolean required)
-
Methods inherited from class com.adobe.aem.dermis.model.ConstraintAsset
getDefaultValue, getExclusiveMaximum, getExclusiveMinimum, getMaximum, getMaxItems, getMaxLength, getMinimum, getMinItems, getMinLength, getPattern, getProtect, getUniqueItems, isReadOnly, setDefaultValue, setExclusiveMaximum, setExclusiveMinimum, setMaximum, setMaxItems, setMaxLength, setMinimum, setMinItems, setMinLength, setPattern, setProtect, setReadOnly, setUniqueItems
-
Methods inherited from class com.adobe.aem.dermis.model.TypedAsset
getFormatType, getMediaBinaryEncoding, getMediaType, getSubType, getSubTypeRef, getType, getTypeRef, setFormatType, setMediaBinaryEncoding, setMediaType, setSubType, setSubTypeRef, setType, setTypeRef
-
Methods inherited from class com.adobe.aem.dermis.model.AbstractAsset
getDescription, getId, getName, getTitle, setDescription, setId, setName, setTitle
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adobe.aem.dermis.model.IAsset
getDescription, getId, getName, getTitle
-
Methods inherited from interface com.adobe.aem.dermis.model.ITypeAsset
getFormatType, getMediaBinaryEncoding, getMediaType, getSubType, getSubTypeRef, getType, getTypeRef, setFormatType, setSubType, setType
-
-
-
-
Constructor Detail
-
Property
public Property()
-
Property
public Property(java.lang.String name, java.lang.String description, PropertyType type)
-
Property
public Property(java.lang.String name, java.lang.String description, PropertyType type, java.lang.String typeRef)
-
Property
public Property(java.lang.String name, PropertyType type, IDataModel dataModel)
-
Property
public Property(java.lang.String name, PropertyType type, IDataModel dataModel, java.lang.Boolean required)
-
Property
public Property(java.lang.String name, PropertyType type, IDataModel dataModel, java.lang.Boolean isPrimaryKey, java.lang.Boolean required)
-
Property
public Property(java.lang.String title, java.lang.String name, java.lang.String description, PropertyType type, java.lang.String typeRef, PropertyType subType, java.lang.String subTypeRef)
-
-
Method Detail
-
getDataModel
public IDataModel getDataModel()
Gets the datamodel for which this property belong- Specified by:
getDataModel
in interfaceIProperty
- Returns:
- this property's datamodel.
-
getRequired
public java.lang.Boolean getRequired()
Determines whether or not this property accepts null values.- Specified by:
getRequired
in interfaceIProperty
- Returns:
- true if this property except values, false if not and null if not known.
-
isNullable
public boolean isNullable()
Determines whether or not this property accepts null values.- Specified by:
isNullable
in interfaceIProperty
- Returns:
- true if this property accept null values, false if not.
-
isPrimaryKey
public java.lang.Boolean isPrimaryKey()
Determines if this property is (one of) the primary key(s) of its datamodel.- Specified by:
isPrimaryKey
in interfaceIProperty
- Returns:
- true if this property is a primary key, or false if not (or if this is not determinable).
-
isComputed
public boolean isComputed()
Determines if this property is a computed property.- Specified by:
isComputed
in interfaceIProperty
- Returns:
- true if this property is a computed property, or false if not
-
getChildDataModel
public IDataModel getChildDataModel()
Gets the associated data model.- Specified by:
getChildDataModel
in interfaceIProperty
- Returns:
- the associated dataModel.
-
getAssociatedDataModel
public IDataModel getAssociatedDataModel()
Returns the data model associated with this property either One-To-One or One-To-Many- Specified by:
getAssociatedDataModel
in interfaceIProperty
- Returns:
-
setChildDataModel
public void setChildDataModel(IDataModel childDataModel)
Sets the associated data model.- Specified by:
setChildDataModel
in interfaceIProperty
- Parameters:
childDataModel
- the associated dataModel.
-
setRequired
public void setRequired(java.lang.Boolean required)
-
setNullable
public void setNullable(boolean nullable)
-
getIsPrimaryKey
public java.lang.Boolean getIsPrimaryKey()
-
setIsPrimaryKey
public void setIsPrimaryKey(java.lang.Boolean isPrimaryKey)
-
setDataModel
public void setDataModel(IDataModel dataModel)
-
getParameterType
public java.lang.String getParameterType()
Description copied from interface:IProperty
Gets the parameter type of this property.- Specified by:
getParameterType
in interfaceIProperty
- Returns:
- the parameter type of this property.
-
setParameterType
public void setParameterType(java.lang.String parameterType)
-
getProperties
public java.util.List<? extends IProperty> getProperties()
Gets the properties of this property if property type is Array.- Specified by:
getProperties
in interfaceIProperty
- Returns:
- the list of properties.
-
setProperties
public void setProperties(java.util.List<IProperty> properties)
-
getEnumList
public java.lang.Object[] getEnumList()
Gets the enum related of this property.- Specified by:
getEnumList
in interfaceIProperty
- Returns:
- the enum related of this property.
-
setEnumList
public void setEnumList(java.lang.Object[] enumList)
-
addAssociation
public void addAssociation(PropertyType associationType, IDataModel dataModel) throws DermisException
Add the associated datamodel- Parameters:
associationType
- association type either COLLECTION or OBJECTdataModel
- associated data model- Throws:
DermisException
-
getReferenceName
public java.lang.String getReferenceName()
Returns the reference entity name.- Specified by:
getReferenceName
in interfaceIProperty
- Returns:
- Returns the reference entity name.
-
getIdentifier
public java.lang.String getIdentifier()
Description copied from interface:IProperty
Gets the identifier of this property.- Specified by:
getIdentifier
in interfaceIProperty
- Returns:
- the identifier of this property.
-
isComplexType
public boolean isComplexType()
Returns true if attribute is of type ARRAY or OBJECT.- Specified by:
isComplexType
in interfaceIProperty
- Returns:
- - Returns true if attribute is of type ARRAY or OBJECT.
-
isArrayOfPrimitive
public boolean isArrayOfPrimitive()
Returns true, if attribute is array of primitive i.e.TypedAsset.getType()
isPropertyType.ARRAY
andTypedAsset.subType
is primtive- Returns:
- Returns true, if attribute is array of primitives.
-
getRules
public IRule getRules()
Description copied from interface:IProperty
Returns the rules of the attribute.
-
isBelowCollection
public boolean isBelowCollection()
Return true if property is part of collection entity. This property is available only if property is retrieved viaIFormDataModelManager.getEntityPropertyByPath(String, String)
- Specified by:
isBelowCollection
in interfaceIProperty
- Returns:
- - true, if property is part of collection entity.
-
isPrimitiveType
public boolean isPrimitiveType()
Returns true if attribute is of primitive type.- Specified by:
isPrimitiveType
in interfaceIProperty
- Returns:
- - Returns true if attribute is of primitive type.
-
isMetadataKey
public java.lang.Boolean isMetadataKey()
Determines if this property is the metadata key(s) of its datamodel. Metadata specifies, that the particular property will be saved as metadata apart from original data i.e user can query on the basis of properties with metadata enabled.- Specified by:
isMetadataKey
in interfaceIProperty
- Returns:
- true if this property is a metadata key, or false if not (or if this is not determinable).
-
-