ReportMill 11 API

com.reportmill.datasource
Class RMProperty

java.lang.Object
  extended by com.reportmill.base.RMObject
      extended by com.reportmill.datasource.RMProperty
All Implemented Interfaces:
com.reportmill.base.RMPropertyChanger, java.lang.Cloneable, java.lang.Comparable

public class RMProperty
extends com.reportmill.base.RMObject
implements java.lang.Comparable

This class describes an attribute of an entity.


Nested Class Summary
static class RMProperty.Type
           
 
Constructor Summary
RMProperty()
          Creates a new property.
RMProperty(java.lang.String aName)
          Creates a new property with given name.
RMProperty(java.lang.String aName, RMProperty.Type aType)
          Creates a new property with given name and type.
 
Method Summary
 RMProperty clone()
          Standard clone implementation.
 int compareTo(java.lang.Object anObj)
          Implements comparable to compare based on name.
 java.lang.Object convertValue(java.lang.Object anObj)
          Converts an arbitrary object to property type.
 boolean equals(java.lang.Object anObj)
          Standard equals implementation.
 RMProperty fromXML(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
          XML unarchival.
 java.lang.String getAlias()
          Returns the alias for this property.
 java.lang.Object getDefaultValue()
          Returns default value for this property.
 RMEntity getEntity()
          Returns the entity that owns this property.
 java.util.List<java.lang.String> getEnumValues()
          Returns the enum values (for type Enum).
 java.lang.String getEnumValuesString()
          Returns the enum values as a string (comma separated).
 java.lang.String getName()
          Returns the name of this property.
 int getNextUniqueId()
          Returns a unique id issued by this property.
 RMEntity getRelationEntity()
          Returns the relation entity.
 java.lang.String getRelationEntityName()
          Returns the name of the entity that this relation property points to.
 RMProperty getRelationLocalProperty()
          Returns the relation local property.
 java.lang.String getRelationLocalPropertyName()
          Returns the property name local to this property's entity that the relation uses as a key (primary or foreign).
 RMProperty getRelationRemoteProperty()
          Returns the relation remote property.
 java.lang.String getRelationRemotePropertyName()
          Returns the property name that the relation uses as a key in the remote table (primary or foreign).
 RMProperty.Type getType()
          Returns the type of this property.
 boolean isAttribute()
          Returns whether this property is a simple attribute.
 boolean isAutoGenerated()
          Returns whether column is automatically generated (numbered), thus read-only.
 boolean isNullable()
          Returns whether property allows nulls.
 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 mergeProperty(RMProperty aProperty)
          Merges a property to this property.
 void setAutoGenerated(boolean aValue)
          Sets whether column is automatically generated (numbered), thus read-only.
 void setDefaultValue(java.lang.Object aValue)
          Sets default value for this property.
 void setEntity(RMEntity anEntity)
          Sets the entity that owns this property.
 void setEnumValues(java.util.List<java.lang.String> theValues)
          Sets the enum values (for type Enum).
 void setEnumValuesString(java.lang.String aValue)
          Sets the enum values as a string (comma separated).
 void setName(java.lang.String aName)
          Sets the name of this property.
 void setNullable(boolean aValue)
          Sets whether property allows nulls.
 void setPrimary(boolean isPrimary)
          Sets whether this property is a primary key.
 void setPrivate(boolean isPrivate)
          Sets whether this property is private.
 void setRelationEntityName(java.lang.String aName)
          Sets the name of the entity that this relation property points to.
 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).
 void setRelationRemotePropertyName(java.lang.String aName)
          Sets the property name that the relation uses as a key in the remote table (primary or foreign).
 void setToMany(boolean aValue)
          Sets whether this property is a to many relation.
 void setType(RMProperty.Type aType)
          Sets the type of this property.
 void setTypeFromSample(java.lang.String aSample)
          Sets property type from sample string - tries to discern whether string represents a date or number.
 void setTypeName(java.lang.String aName)
          Sets the type from a given name.
 java.lang.String toString()
          Returns a string representation of this property (its name).
 com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver, java.lang.Object anOwner)
          XML archival.
 java.lang.Object valueOf(java.lang.String aString)
          Converts xml attribute string to a specific type.
 
Methods inherited from class com.reportmill.base.RMObject
addListener, addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, getListener, getListenerCount, getListeners, isFirePropertyChangeEnabled, isUndoing, removeListener, removePropertyChangeListener, setFirePropertyChangeEnabled, setUndoing
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RMProperty

public RMProperty()
Creates a new property.


RMProperty

public RMProperty(java.lang.String aName)
Creates a new property with given name.


RMProperty

public RMProperty(java.lang.String aName,
                  RMProperty.Type aType)
Creates a new property with given name and type.

Method Detail

getEntity

public RMEntity getEntity()
Returns the entity that owns this property.


setEntity

public void setEntity(RMEntity anEntity)
Sets the entity that owns this property.


getName

public java.lang.String getName()
Returns the name of this property.


setName

public void setName(java.lang.String aName)
Sets the name of this property.


getAlias

public java.lang.String getAlias()
Returns the alias for this property.


getType

public RMProperty.Type getType()
Returns the type of this property.


setType

public void setType(RMProperty.Type aType)
Sets the type of this property.


setTypeName

public void setTypeName(java.lang.String aName)
Sets the type from a given name.


setTypeFromSample

public void setTypeFromSample(java.lang.String aSample)
Sets property type from sample string - tries to discern whether string represents a date or number.


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.


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.


getDefaultValue

public java.lang.Object getDefaultValue()
Returns default value for this property.


setDefaultValue

public void setDefaultValue(java.lang.Object aValue)
Sets default value for this property.


getEnumValues

public java.util.List<java.lang.String> getEnumValues()
Returns the enum values (for type Enum).


setEnumValues

public void setEnumValues(java.util.List<java.lang.String> theValues)
Sets the enum values (for type Enum).


getEnumValuesString

public java.lang.String getEnumValuesString()
Returns the enum values as a string (comma separated).


setEnumValuesString

public void setEnumValuesString(java.lang.String aValue)
Sets the enum values as a 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.


setToMany

public void setToMany(boolean aValue)
Sets whether this property is a to many relation.


getRelationEntityName

public java.lang.String getRelationEntityName()
Returns the name of the entity that this relation property points to.


setRelationEntityName

public void setRelationEntityName(java.lang.String aName)
Sets the name of the entity that this relation property points to.


getRelationLocalPropertyName

public java.lang.String getRelationLocalPropertyName()
Returns the property name local to this property's entity that the relation uses as a key (primary or foreign).


setRelationLocalPropertyName

public 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).


getRelationRemotePropertyName

public java.lang.String getRelationRemotePropertyName()
Returns the property name that the relation uses as a key in the remote table (primary or foreign).


setRelationRemotePropertyName

public void setRelationRemotePropertyName(java.lang.String aName)
Sets the property name that the relation uses as a key in the remote table (primary or foreign).


getRelationEntity

public RMEntity getRelationEntity()
Returns the relation entity.


getRelationLocalProperty

public RMProperty getRelationLocalProperty()
Returns the relation local property.


getRelationRemoteProperty

public RMProperty getRelationRemoteProperty()
Returns the relation remote property.


getNextUniqueId

public int getNextUniqueId()
Returns a unique id issued by this property.


valueOf

public java.lang.Object valueOf(java.lang.String aString)
Converts xml attribute string to a specific type.


convertValue

public java.lang.Object convertValue(java.lang.Object anObj)
Converts an arbitrary object to property type.


mergeProperty

public void mergeProperty(RMProperty aProperty)
Merges a property to this property.


equals

public boolean equals(java.lang.Object anObj)
Standard equals implementation.

Overrides:
equals in class java.lang.Object

clone

public RMProperty clone()
Standard clone implementation.

Overrides:
clone in class com.reportmill.base.RMObject

compareTo

public int compareTo(java.lang.Object anObj)
Implements comparable to compare based on name.

Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Returns a string representation of this property (its name).

Overrides:
toString in class java.lang.Object

toXML

public com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver,
                                               java.lang.Object anOwner)
XML archival.


fromXML

public RMProperty fromXML(com.reportmill.archiver.RXArchiver anArchiver,
                          com.reportmill.archiver.RXElement anElement,
                          java.lang.Object anOwner)
XML unarchival.


ReportMill 11 API