public class RMEntity
extends com.reportmill.base.RMObject
implements java.beans.PropertyChangeListener
Constructor and Description |
---|
RMEntity()
Creates an empty entity.
|
RMEntity(java.lang.String name)
Creates an entity with the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
addProperty(RMProperty aProperty)
Adds a given property.
|
void |
addProperty(RMProperty aProperty,
int anIndex)
Adds a given property at given index.
|
RMEntity |
clone()
Standard clone implementation.
|
RMEntity |
clone(RMEntity anEntity)
Makes this entity a copy of the given entity.
|
boolean |
equals(java.lang.Object anObj)
Standard equals method.
|
RMEntity |
fromXML(com.reportmill.archiver.RXArchiver anArchiver,
com.reportmill.archiver.RXElement anElement,
java.lang.Object anOwner)
XML unarchival.
|
RMProperty |
getAttribute(int anIndex)
Returns the attribute at the given index.
|
RMProperty |
getAttribute(java.lang.String aName)
Returns the attribute with the given name.
|
int |
getAttributeCount()
Returns the number of attributes.
|
RMProperty |
getAttributeSorted(int anIndex)
Returns the attribute at the given index in a sorted attributes list.
|
java.lang.String |
getDescriptorKey()
Returns the key/key-chain to the property(s) that returns best string description of an entity instance.
|
java.lang.String |
getDescriptorKeyGuess()
Returns a guess of descriptor key (or the actual one, if set).
|
java.lang.Class |
getEntityClass()
Returns the class that this entity represents.
|
java.lang.String |
getName()
Returns the name of the entity.
|
java.util.List<RMProperty> |
getPrimaries()
Returns the list of primary attributes for this entity.
|
RMProperty |
getPrimary()
Returns the primary key property.
|
java.util.List<? extends RMProperty> |
getProperties()
Returns the list of properties.
|
RMProperty |
getProperty(int anIndex)
Returns the property at the given index.
|
RMProperty |
getProperty(RMKeyChain aKeyChain)
Returns the property for the keychain evaluated from this entity.
|
RMProperty |
getProperty(java.lang.String aName)
Returns the property with the given name.
|
int |
getPropertyCount()
Returns the number of properties.
|
RMProperty |
getRelation(int anIndex)
Returns the relation at the given index.
|
RMProperty |
getRelation(java.lang.String aKeyPath)
Returns the relation for the given key path.
|
int |
getRelationCount()
Returns the number of relations in the entity.
|
RMEntity |
getRelationEntity(java.lang.String aKeyPath)
Returns the relation entity for the key path evaluated from this entity.
|
java.util.List<RMProperty> |
getRelations()
Returns the list of relations in the entity.
|
RMProperty |
getRelationSorted(int anIndex)
Returns the relation at the given index in the sorted list of relations.
|
RMSchema |
getSchema()
Returns the schema that owns this entity.
|
void |
propertyChange(java.beans.PropertyChangeEvent anEvent)
PropertyChangeListener implementation to forward property changes to entity property change listener.
|
java.lang.Object |
removeProperty(int anIndex)
Removes a property at given index.
|
int |
removeProperty(RMProperty aProperty)
Removes the given property.
|
void |
setDescriptorKey(java.lang.String aValue)
Sets the key/key-chain to the property(s) that returns best string description of an entity instance.
|
void |
setEntityClass(java.lang.Class aClass)
Sets the class that this entity represents.
|
void |
setName(java.lang.String aName)
Sets the name of the entity.
|
void |
setProperties(java.util.List<? extends RMProperty> theProperties)
Sets a list of properties.
|
void |
setSchema(RMSchema aSchema)
Sets the schema that owns this entity.
|
java.lang.String |
toString()
Returns a string representation of entity (its name).
|
com.reportmill.archiver.RXElement |
toXML(com.reportmill.archiver.RXArchiver anArchiver,
java.lang.Object anOwner)
XML archival.
|
addListener, addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, getListener, getListenerCount, getListeners, isFirePropertyChangeEnabled, isUndoing, removeListener, removePropertyChangeListener, setFirePropertyChangeEnabled, setUndoing
public RMEntity()
public RMEntity(java.lang.String name)
public RMSchema getSchema()
public void setSchema(RMSchema aSchema)
public java.lang.String getName()
public void setName(java.lang.String aName)
public int getPropertyCount()
public RMProperty getProperty(int anIndex)
public java.util.List<? extends RMProperty> getProperties()
public void setProperties(java.util.List<? extends RMProperty> theProperties)
public void addProperty(RMProperty aProperty)
public void addProperty(RMProperty aProperty, int anIndex)
public java.lang.Object removeProperty(int anIndex)
public int removeProperty(RMProperty aProperty)
public RMProperty getProperty(java.lang.String aName)
public RMProperty getProperty(RMKeyChain aKeyChain)
public int getAttributeCount()
public RMProperty getAttribute(int anIndex)
public RMProperty getAttribute(java.lang.String aName)
public int getRelationCount()
public RMProperty getRelation(int anIndex)
public java.util.List<RMProperty> getRelations()
public RMProperty getRelation(java.lang.String aKeyPath)
public RMEntity getRelationEntity(java.lang.String aKeyPath)
public RMProperty getAttributeSorted(int anIndex)
public RMProperty getRelationSorted(int anIndex)
public RMProperty getPrimary()
public java.util.List<RMProperty> getPrimaries()
public java.lang.Class getEntityClass()
public void setEntityClass(java.lang.Class aClass)
public java.lang.String getDescriptorKey()
public void setDescriptorKey(java.lang.String aValue)
public java.lang.String getDescriptorKeyGuess()
public void propertyChange(java.beans.PropertyChangeEvent anEvent)
propertyChange
in interface java.beans.PropertyChangeListener
public boolean equals(java.lang.Object anObj)
equals
in class java.lang.Object
public RMEntity clone()
clone
in class com.reportmill.base.RMObject
public com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver, java.lang.Object anOwner)
public RMEntity fromXML(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
public java.lang.String toString()
toString
in class com.reportmill.base.RMObject