Package com.ribs.datasource
Class RMProperty
- java.lang.Object
-
- com.ribs.datasource.RMProperty
-
public class RMProperty extends java.lang.ObjectThis class describes an attribute of an entity.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTY_TYPE_BINARYstatic java.lang.StringPROPERTY_TYPE_BOOLEANstatic java.lang.StringPROPERTY_TYPE_DATEstatic java.lang.StringPROPERTY_TYPE_LISTstatic java.lang.StringPROPERTY_TYPE_MAPstatic java.lang.StringPROPERTY_TYPE_NUMBERstatic java.lang.StringPROPERTY_TYPE_STRING
-
Constructor Summary
Constructors Constructor Description RMProperty()Creates an uninitialized property.RMProperty(java.lang.String aName, java.lang.String aType, java.lang.String aSubtype, boolean isPrimary, boolean isPrivate)Creates a property with the given name and type and subtype.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectconvertToType(java.lang.String aValue)Converts the given string to the properties type.booleanequals(java.lang.Object anObj)Standard equals implementation.java.lang.ObjectfromXML(RXArchiver anArchiver, RXElement anElement)XML unarchival.java.lang.StringgetName()Returns the name of this property.intgetNextUniqueId()Returns a unique id issued by this property.java.lang.StringgetSubtype()Returns the subtype of this property.java.lang.ClassgetSubtypeClass()Returns the subtype class.java.lang.StringgetType()Returns the type of this property.booleanisAttribute()Returns whether this property is a simple attribute.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.voidsetPrimary(boolean isPrimary)Sets whether this property is a primary key.voidsetPrivate(boolean isPrivate)Sets whether this property is private.voidsetSubtype(java.lang.String aSubType)Sets the subtype of this property.voidsetSubtypeClass(java.lang.Class aClass)Sets the subtype class.voidsetType(java.lang.String aType)Sets the type of this property.java.lang.StringtoString()Returns a string representation of this property (its name).RXElementtoXML(RXArchiver anArchiver)XML archival.
-
-
-
Field Detail
-
PROPERTY_TYPE_STRING
public static final java.lang.String PROPERTY_TYPE_STRING
- See Also:
- Constant Field Values
-
PROPERTY_TYPE_NUMBER
public static final java.lang.String PROPERTY_TYPE_NUMBER
- See Also:
- Constant Field Values
-
PROPERTY_TYPE_DATE
public static final java.lang.String PROPERTY_TYPE_DATE
- See Also:
- Constant Field Values
-
PROPERTY_TYPE_BOOLEAN
public static final java.lang.String PROPERTY_TYPE_BOOLEAN
- See Also:
- Constant Field Values
-
PROPERTY_TYPE_BINARY
public static final java.lang.String PROPERTY_TYPE_BINARY
- See Also:
- Constant Field Values
-
PROPERTY_TYPE_LIST
public static final java.lang.String PROPERTY_TYPE_LIST
- See Also:
- Constant Field Values
-
PROPERTY_TYPE_MAP
public static final java.lang.String PROPERTY_TYPE_MAP
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of this property.
-
getType
public java.lang.String getType()
Returns the type of this property.
-
setType
public void setType(java.lang.String aType)
Sets the type of this property.
-
getSubtype
public java.lang.String getSubtype()
Returns the subtype of this property.
-
setSubtype
public void setSubtype(java.lang.String aSubType)
Sets the subtype of this property.
-
getSubtypeClass
public java.lang.Class getSubtypeClass()
Returns the subtype class.
-
setSubtypeClass
public void setSubtypeClass(java.lang.Class aClass)
Sets the subtype class.
-
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.
-
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.
-
convertToType
public java.lang.Object convertToType(java.lang.String aValue)
Converts the given string to the properties type.
-
getNextUniqueId
public int getNextUniqueId()
Returns a unique id issued by this property.
-
equals
public boolean equals(java.lang.Object anObj)
Standard equals implementation.- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a string representation of this property (its name).- Overrides:
toStringin classjava.lang.Object
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML archival.
-
fromXML
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.
-
-