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,- java.lang.Cloneable,- java.lang.Comparable
 
 public class Property extends RMObject implements java.lang.Comparable, RMJSONArchiver.GetKeys, Archivable This class describes an attribute of an entity.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classProperty.DateTypestatic classProperty.NumberTypestatic classProperty.StringSizestatic classProperty.Type
 - 
Constructor SummaryConstructors Constructor Description Property()Creates a new property.Property(java.lang.String aName)Creates a new property with given name.Property(java.lang.String aName, Property.Type aType)Creates a new property with given name and type.Property(java.lang.String aName, java.lang.Object aType)Creates a new property with given name and type.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Propertyclone()Standard clone implementation.intcompareTo(java.lang.Object anObj)Implements comparable to compare based on name.java.lang.ObjectconvertValue(java.lang.Object anObj)Converts an arbitrary object to property type.booleanequals(java.lang.Object anObj)Standard equals implementation.PropertyfromXML(RXArchiver anArchiver, RXElement anElement)XML unarchival.Property.DateTypegetDateType()Returns the date type.Property.DateTypegetDateTypeDefault()Returns the default date type.java.lang.ObjectgetDefaultValue()Returns default value for this property.EntitygetEntity()Returns the entity that owns this property.java.lang.StringgetEnumsString()Returns the enum strings as a single string (comma separated).java.util.List<java.lang.String>getEnumStrings()Returns the enum strings (for type Enum).java.util.List<java.lang.String>getJSONKeys()Returns JSON keys.java.lang.ObjectgetKeyValue(java.lang.String aKey)RMKey.Get implementation to return Property for key from RelationEntity (if found).java.lang.StringgetName()Returns the name of this property.booleangetNullableDefault()Returns the nullable default.Property.NumberTypegetNumberType()Returns the number type.Property.NumberTypegetNumberTypeDefault()Return default number type.EntitygetRelationEntity()Returns the relation entity.java.lang.StringgetRelationEntityName()Returns the name of the entity that this relation property points to.PropertygetRelationLocalProperty()Returns the relation local property.java.lang.StringgetRelationLocalPropertyName()Returns the property name local to this property's entity that the relation uses as a key (primary or foreign).PropertygetRelationRemoteProperty()Returns the relation remote property.java.lang.StringgetRelationRemotePropertyName()Returns the property name that the relation uses as a key in the remote table (primary or foreign).java.lang.StringgetStandardName()Returns the name in a standard format (strip is/get prefix and start with capital letter).Property.StringSizegetStringSize()Returns the string size.Property.StringSizegetStringSizeDefault()Return default string size.Property.TypegetType()Returns the type of this property.booleanisAttribute()Returns whether this property is a simple attribute.booleanisAutoGenerated()Returns whether column is automatically generated (numbered), thus read-only.booleanisDerived()Returns whether property value is derived from other properties and doesn't require persistence.booleanisNullable()Returns whether property allows nulls.booleanisPrimary()Returns whether this property is a primary key.booleanisPrivate()Returns whether this property is private.booleanisRelation()Returns whether this property is a relation.booleanisToMany()Returns whether this property is a to many relation.voidsetAutoGenerated(boolean aValue)Sets whether column is automatically generated (numbered), thus read-only.voidsetDateType(Property.DateType aDateType)Sets the date type.voidsetDefaultValue(java.lang.Object aValue)Sets default value for this property.voidsetEntity(Entity anEntity)Sets the entity that owns this property.voidsetEnumsString(java.lang.String aValue)Sets the enum strings as a single string (comma separated).voidsetEnumStrings(java.util.List<java.lang.String> theValues)Sets the enum strings (for type Enum).voidsetName(java.lang.String aName)Sets the name of this property.voidsetNullable(boolean aValue)Sets whether property allows nulls.voidsetNumberType(Property.NumberType aNumberType)Sets the number type.voidsetPrimary(boolean isPrimary)Sets whether this property is a primary key.voidsetPrivate(boolean isPrivate)Sets whether this property is private.voidsetRelationEntity(Entity anEntity)Sets the relation entity.voidsetRelationEntityName(java.lang.String aName)Sets the name of the entity that this relation property points to.voidsetRelationLocalPropertyName(java.lang.String aName)Sets the property name local to this property's entity that the relation uses as a key (primary or foreign).voidsetRelationRemotePropertyName(java.lang.String aName)Sets the property name that the relation uses as a key in the remote table (primary or foreign).voidsetStringSize(Property.StringSize aSize)Sets the string size.voidsetToMany(boolean aValue)Sets whether this property is a to many relation.voidsetType(Property.Type aType)Sets the type of this property.voidsetTypeFromSample(java.lang.String aSample)Sets property type from sample string - tries to discern whether string represents a date or number.voidsetTypeName(java.lang.String aName)Sets the type from a given name.java.lang.StringtoString()Returns a string representation of this property (its name).java.lang.StringtoString(java.lang.Object aValue)Returns a string representation of given value according to property type.RXElementtoXML(RXArchiver anArchiver)XML archival.- 
Methods inherited from class com.inductiveautomation.rm.base.RMObjectaddPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
 - 
Methods inherited from class com.inductiveautomation.rm.base.RMListenerListaddListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
 
- 
 
- 
- 
- 
Constructor Detail- 
Propertypublic Property() Creates a new property.
 - 
Propertypublic Property(java.lang.String aName) Creates a new property with given name.
 - 
Propertypublic Property(java.lang.String aName, Property.Type aType)Creates a new property with given name and type.
 - 
Propertypublic Property(java.lang.String aName, java.lang.Object aType)Creates a new property with given name and type.
 
- 
 - 
Method Detail- 
getEntitypublic Entity getEntity() Returns the entity that owns this property.
 - 
setEntitypublic void setEntity(Entity anEntity) Sets the entity that owns this property.
 - 
getName@Nonnull public java.lang.String getName() Returns the name of this property.
 - 
setNamepublic void setName(java.lang.String aName) Sets the name of this property.
 - 
getStandardNamepublic java.lang.String getStandardName() Returns the name in a standard format (strip is/get prefix and start with capital letter).
 - 
getTypepublic Property.Type getType() Returns the type of this property.
 - 
setTypepublic void setType(Property.Type aType) Sets the type of this property.
 - 
setTypeNamepublic void setTypeName(java.lang.String aName) Sets the type from a given name.
 - 
setTypeFromSamplepublic void setTypeFromSample(java.lang.String aSample) Sets property type from sample string - tries to discern whether string represents a date or number.
 - 
isPrimarypublic boolean isPrimary() Returns whether this property is a primary key.
 - 
setPrimarypublic void setPrimary(boolean isPrimary) Sets whether this property is a primary key.
 - 
isPrivatepublic boolean isPrivate() Returns whether this property is private.
 - 
setPrivatepublic void setPrivate(boolean isPrivate) Sets whether this property is private.
 - 
getStringSizepublic Property.StringSize getStringSize() Returns the string size.
 - 
setStringSizepublic void setStringSize(Property.StringSize aSize) Sets the string size.
 - 
getStringSizeDefaultpublic Property.StringSize getStringSizeDefault() Return default string size.
 - 
getNumberTypepublic Property.NumberType getNumberType() Returns the number type.
 - 
setNumberTypepublic void setNumberType(Property.NumberType aNumberType) Sets the number type.
 - 
getNumberTypeDefaultpublic Property.NumberType getNumberTypeDefault() Return default number type.
 - 
getDateTypepublic Property.DateType getDateType() Returns the date type.
 - 
setDateTypepublic void setDateType(Property.DateType aDateType) Sets the date type.
 - 
getDateTypeDefaultpublic Property.DateType getDateTypeDefault() Returns the default date type.
 - 
isAutoGeneratedpublic boolean isAutoGenerated() Returns whether column is automatically generated (numbered), thus read-only.
 - 
setAutoGeneratedpublic void setAutoGenerated(boolean aValue) Sets whether column is automatically generated (numbered), thus read-only.
 - 
isNullablepublic boolean isNullable() Returns whether property allows nulls.
 - 
setNullablepublic void setNullable(boolean aValue) Sets whether property allows nulls.
 - 
getNullableDefaultpublic boolean getNullableDefault() Returns the nullable default.
 - 
getDefaultValuepublic java.lang.Object getDefaultValue() Returns default value for this property.
 - 
setDefaultValuepublic void setDefaultValue(java.lang.Object aValue) Sets default value for this property.
 - 
getEnumStringspublic java.util.List<java.lang.String> getEnumStrings() Returns the enum strings (for type Enum).
 - 
setEnumStringspublic void setEnumStrings(java.util.List<java.lang.String> theValues) Sets the enum strings (for type Enum).
 - 
getEnumsStringpublic java.lang.String getEnumsString() Returns the enum strings as a single string (comma separated).
 - 
setEnumsStringpublic void setEnumsString(java.lang.String aValue) Sets the enum strings as a single string (comma separated).
 - 
isAttributepublic boolean isAttribute() Returns whether this property is a simple attribute.
 - 
isRelationpublic boolean isRelation() Returns whether this property is a relation.
 - 
isToManypublic boolean isToMany() Returns whether this property is a to many relation.
 - 
isDerivedpublic 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.
 - 
setToManypublic void setToMany(boolean aValue) Sets whether this property is a to many relation.
 - 
getRelationEntitypublic Entity getRelationEntity() Returns the relation entity.
 - 
setRelationEntitypublic void setRelationEntity(Entity anEntity) Sets the relation entity.
 - 
getRelationEntityNamepublic java.lang.String getRelationEntityName() Returns the name of the entity that this relation property points to.
 - 
setRelationEntityNamepublic void setRelationEntityName(java.lang.String aName) Sets the name of the entity that this relation property points to.
 - 
getRelationLocalPropertyNamepublic java.lang.String getRelationLocalPropertyName() Returns the property name local to this property's entity that the relation uses as a key (primary or foreign).
 - 
setRelationLocalPropertyNamepublic void setRelationLocalPropertyName(java.lang.String aName) Sets the property name local to this property's entity that the relation uses as a key (primary or foreign).
 - 
getRelationRemotePropertyNamepublic java.lang.String getRelationRemotePropertyName() Returns the property name that the relation uses as a key in the remote table (primary or foreign).
 - 
setRelationRemotePropertyNamepublic void setRelationRemotePropertyName(java.lang.String aName) Sets the property name that the relation uses as a key in the remote table (primary or foreign).
 - 
getRelationLocalPropertypublic Property getRelationLocalProperty() Returns the relation local property.
 - 
getRelationRemotePropertypublic Property getRelationRemoteProperty() Returns the relation remote property.
 - 
convertValuepublic java.lang.Object convertValue(java.lang.Object anObj) Converts an arbitrary object to property type.
 - 
getKeyValuepublic java.lang.Object getKeyValue(java.lang.String aKey) RMKey.Get implementation to return Property for key from RelationEntity (if found).
 - 
toStringpublic java.lang.String toString(java.lang.Object aValue) Returns a string representation of given value according to property type.
 - 
equalspublic boolean equals(java.lang.Object anObj) Standard equals implementation.- Overrides:
- equalsin class- java.lang.Object
 
 - 
clonepublic Property clone() Standard clone implementation.- Overrides:
- clonein class- RMListenerList
 
 - 
compareTopublic int compareTo(java.lang.Object anObj) Implements comparable to compare based on name.- Specified by:
- compareToin interface- java.lang.Comparable
 
 - 
toXMLpublic RXElement toXML(RXArchiver anArchiver) XML archival.- Specified by:
- toXMLin interface- Archivable
 
 - 
fromXMLpublic Property fromXML(RXArchiver anArchiver, RXElement anElement) XML unarchival.- Specified by:
- fromXMLin interface- Archivable
 
 - 
getJSONKeyspublic java.util.List<java.lang.String> getJSONKeys() Returns JSON keys.- Specified by:
- getJSONKeysin interface- RMJSONArchiver.GetKeys
 
 
- 
 
-