Class Property
java.lang.Object
com.inductiveautomation.rm.base.RMListenerList
com.inductiveautomation.rm.base.RMObject
com.inductiveautomation.snap.data.Property
- All Implemented Interfaces:
Archivable
,RMJSONArchiver.GetKeys
,RMPropertyChanger
,Cloneable
,Comparable
This class describes an attribute of an entity.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static enum
static enum
static enum
-
Constructor Summary
ConstructorsConstructorDescriptionProperty()
Creates a new property.Creates a new property with given name.Property
(String aName, Property.Type aType) Creates a new property with given name and type.Creates a new property with given name and type. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Standard clone implementation.int
Implements comparable to compare based on name.convertValue
(Object anObj) Converts an arbitrary object to property type.boolean
Standard equals implementation.fromXML
(RXArchiver anArchiver, RXElement anElement) XML unarchival.Returns the date type.Returns the default date type.Returns default value for this property.Returns the entity that owns this property.Returns the enum strings as a single string (comma separated).Returns the enum strings (for type Enum).Returns JSON keys.getKeyValue
(String aKey) RMKey.Get implementation to return Property for key from RelationEntity (if found).getName()
Returns the name of this property.boolean
Returns the nullable default.Returns the number type.Return default number type.Returns the relation entity.Returns the name of the entity that this relation property points to.Returns the relation local property.Returns the property name local to this property's entity that the relation uses as a key (primary or foreign).Returns the relation remote property.Returns the property name that the relation uses as a key in the remote table (primary or foreign).Returns the name in a standard format (strip is/get prefix and start with capital letter).Returns the string size.Return default string size.getType()
Returns the type of this property.boolean
Returns whether this property is a simple attribute.boolean
Returns whether column is automatically generated (numbered), thus read-only.boolean
Returns whether property value is derived from other properties and doesn't require persistence.boolean
Returns whether property allows nulls.boolean
Returns whether this property is a primary key.boolean
Returns whether this property is private.boolean
Returns whether this property is a relation.boolean
isToMany()
Returns whether this property is a to many relation.void
setAutoGenerated
(boolean aValue) Sets whether column is automatically generated (numbered), thus read-only.void
setDateType
(Property.DateType aDateType) Sets the date type.void
setDefaultValue
(Object aValue) Sets default value for this property.void
Sets the entity that owns this property.void
setEnumsString
(String aValue) Sets the enum strings as a single string (comma separated).void
setEnumStrings
(List<String> theValues) Sets the enum strings (for type Enum).void
Sets the name of this property.void
setNullable
(boolean aValue) Sets whether property allows nulls.void
setNumberType
(Property.NumberType aNumberType) Sets the number type.void
setPrimary
(boolean isPrimary) Sets whether this property is a primary key.void
setPrivate
(boolean isPrivate) Sets whether this property is private.void
setRelationEntity
(Entity anEntity) Sets the relation entity.void
setRelationEntityName
(String aName) Sets the name of the entity that this relation property points to.void
Sets the property name local to this property's entity that the relation uses as a key (primary or foreign).void
Sets the property name that the relation uses as a key in the remote table (primary or foreign).void
setStringSize
(Property.StringSize aSize) Sets the string size.void
setToMany
(boolean aValue) Sets whether this property is a to many relation.void
setType
(Property.Type aType) Sets the type of this property.void
setTypeFromSample
(String aSample) Sets property type from sample string - tries to discern whether string represents a date or number.void
setTypeName
(String aName) Sets the type from a given name.toString()
Returns a string representation of this property (its name).Returns a string representation of given value according to property type.toXML
(RXArchiver anArchiver) XML archival.Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
Constructor Details
-
Property
public Property()Creates a new property. -
Property
Creates a new property with given name. -
Property
Creates a new property with given name and type. -
Property
Creates a new property with given name and type.
-
-
Method Details
-
getEntity
Returns the entity that owns this property. -
setEntity
Sets the entity that owns this property. -
getName
Returns the name of this property. -
setName
Sets the name of this property. -
getStandardName
Returns the name in a standard format (strip is/get prefix and start with capital letter). -
getType
Returns the type of this property. -
setType
Sets the type of this property. -
setTypeName
Sets the type from a given name. -
setTypeFromSample
Sets property type from sample string - tries to discern whether string represents a date or number. -
isPrimary
public boolean isPrimary()Returns whether this property is a primary key. -
setPrimary
public void setPrimary(boolean isPrimary) Sets whether this property is a primary key. -
isPrivate
public boolean isPrivate()Returns whether this property is private. -
setPrivate
public void setPrivate(boolean isPrivate) Sets whether this property is private. -
getStringSize
Returns the string size. -
setStringSize
Sets the string size. -
getStringSizeDefault
Return default string size. -
getNumberType
Returns the number type. -
setNumberType
Sets the number type. -
getNumberTypeDefault
Return default number type. -
getDateType
Returns the date type. -
setDateType
Sets the date type. -
getDateTypeDefault
Returns the default date type. -
isAutoGenerated
public boolean isAutoGenerated()Returns whether column is automatically generated (numbered), thus read-only. -
setAutoGenerated
public void setAutoGenerated(boolean aValue) Sets whether column is automatically generated (numbered), thus read-only. -
isNullable
public boolean isNullable()Returns whether property allows nulls. -
setNullable
public void setNullable(boolean aValue) Sets whether property allows nulls. -
getNullableDefault
public boolean getNullableDefault()Returns the nullable default. -
getDefaultValue
Returns default value for this property. -
setDefaultValue
Sets default value for this property. -
getEnumStrings
Returns the enum strings (for type Enum). -
setEnumStrings
Sets the enum strings (for type Enum). -
getEnumsString
Returns the enum strings as a single string (comma separated). -
setEnumsString
Sets the enum strings as a single string (comma separated). -
isAttribute
public boolean isAttribute()Returns whether this property is a simple attribute. -
isRelation
public boolean isRelation()Returns whether this property is a relation. -
isToMany
public boolean isToMany()Returns whether this property is a to many relation. -
isDerived
public boolean isDerived()Returns whether property value is derived from other properties and doesn't require persistence. A common (though advanced) example is a relationship that references the primary key against a foreign table/key. A less sophisticated example would be a property based on an expression comprised of other properties. -
setToMany
public void setToMany(boolean aValue) Sets whether this property is a to many relation. -
getRelationEntity
Returns the relation entity. -
setRelationEntity
Sets the relation entity. -
getRelationEntityName
Returns the name of the entity that this relation property points to. -
setRelationEntityName
Sets the name of the entity that this relation property points to. -
getRelationLocalPropertyName
Returns the property name local to this property's entity that the relation uses as a key (primary or foreign). -
setRelationLocalPropertyName
Sets the property name local to this property's entity that the relation uses as a key (primary or foreign). -
getRelationRemotePropertyName
Returns the property name that the relation uses as a key in the remote table (primary or foreign). -
setRelationRemotePropertyName
Sets the property name that the relation uses as a key in the remote table (primary or foreign). -
getRelationLocalProperty
Returns the relation local property. -
getRelationRemoteProperty
Returns the relation remote property. -
convertValue
Converts an arbitrary object to property type. -
getKeyValue
RMKey.Get implementation to return Property for key from RelationEntity (if found). -
toString
Returns a string representation of given value according to property type. -
equals
Standard equals implementation. -
clone
Standard clone implementation.- Overrides:
clone
in classRMListenerList
-
compareTo
Implements comparable to compare based on name.- Specified by:
compareTo
in interfaceComparable
-
toXML
XML archival.- Specified by:
toXML
in interfaceArchivable
-
fromXML
XML unarchival.- Specified by:
fromXML
in interfaceArchivable
-
getJSONKeys
Returns JSON keys.- Specified by:
getJSONKeys
in interfaceRMJSONArchiver.GetKeys
-
toString
Returns a string representation of this property (its name).
-