Package com.ribs.datasource
Class RMProperty
- java.lang.Object
-
- com.ribs.datasource.RMProperty
-
public class RMProperty extends java.lang.Object
This class describes an attribute of an entity.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_TYPE_BINARY
static java.lang.String
PROPERTY_TYPE_BOOLEAN
static java.lang.String
PROPERTY_TYPE_DATE
static java.lang.String
PROPERTY_TYPE_LIST
static java.lang.String
PROPERTY_TYPE_MAP
static java.lang.String
PROPERTY_TYPE_NUMBER
static java.lang.String
PROPERTY_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.Object
convertToType(java.lang.String aValue)
Converts the given string to the properties type.boolean
equals(java.lang.Object anObj)
Standard equals implementation.java.lang.Object
fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.java.lang.String
getName()
Returns the name of this property.int
getNextUniqueId()
Returns a unique id issued by this property.java.lang.String
getSubtype()
Returns the subtype of this property.java.lang.Class
getSubtypeClass()
Returns the subtype class.java.lang.String
getType()
Returns the type of this property.boolean
isAttribute()
Returns whether this property is a simple attribute.boolean
isPrimary()
Returns whether this property is a primary key.boolean
isPrivate()
Returns whether this property is private.boolean
isRelation()
Returns whether this property is a relation.boolean
isToMany()
Returns whether this property is a to many relation.void
setPrimary(boolean isPrimary)
Sets whether this property is a primary key.void
setPrivate(boolean isPrivate)
Sets whether this property is private.void
setSubtype(java.lang.String aSubType)
Sets the subtype of this property.void
setSubtypeClass(java.lang.Class aClass)
Sets the subtype class.void
setType(java.lang.String aType)
Sets the type of this property.java.lang.String
toString()
Returns a string representation of this property (its name).RXElement
toXML(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:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a string representation of this property (its name).- Overrides:
toString
in classjava.lang.Object
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML archival.
-
fromXML
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.
-
-