ReportMill 10 API

com.reportmill.datasource
Class RMProperty

java.lang.Object
  extended by com.reportmill.datasource.RMProperty
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
RMJoin

public class RMProperty
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable

This class describes an attribute of an entity.


Field Summary
static java.lang.String TYPE_BINARY
           
static java.lang.String TYPE_BOOLEAN
           
static java.lang.String TYPE_DATE
           
static java.lang.String TYPE_LIST
           
static java.lang.String TYPE_MAP
           
static java.lang.String TYPE_NUMBER
           
static java.lang.String TYPE_OTHER
           
static java.lang.String TYPE_STRING
           
 
Constructor Summary
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
 java.lang.Object clone()
          Standard clone implementation.
 int compareTo(java.lang.Object anObj)
          Implements comparable to compare based on name.
 boolean equals(java.lang.Object anObj)
          Standard equals implementation.
 java.lang.Object fromXML(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement)
          XML unarchival.
 java.lang.String getAlias()
          Returns the alias for this property.
 java.text.Format getFormat()
          Returns format for this property.
 java.lang.Object getMetaData(java.lang.String aName)
          Returns a meta data value for a name.
 java.lang.String getName()
          Returns the name of this property.
 int getNextUniqueId()
          Returns a unique id issued by this property.
 int getSQLType()
          Returns the SQL type (one of java.sql.Types).
static int getSQLType(java.lang.String aPropertyType)
          Returns the default SQL type for a given property type.
static int[] getSQLTypes(java.lang.String aPropertyType)
          Returns the default SQL types for a given property type.
 java.lang.String getSQLTypeString()
          Returns the SQL type as a string.
static java.lang.String getSQLTypeString(int sqlType)
          Returns the string for a given sql type.
 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.
static java.lang.String getType(int anSQLType)
          Returns the RMProperty type for an SQL type.
 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.
static boolean isValidTypeSQLTypePair(java.lang.String aPropertyType, int sqlType)
          Returns whether given RMProperty-type/sql-type pair is valid.
 void setFormat(java.text.Format aFormat)
          Sets the format.
 void setMetaData(java.lang.String aName, java.lang.Object aValue)
          Sets a meta data value for a name.
static void setMetaDataValueClass(java.lang.String aName, java.lang.Class aClass)
          Sets a metadata type.
 void setName(java.lang.String aName)
          Sets the name of this property.
 void setPrimary(boolean isPrimary)
          Sets whether this property is a primary key.
 void setPrivate(boolean isPrivate)
          Sets whether this property is private.
 void setSQLType(int aType)
          Sets the SQL type (one of java.sql.Types).
 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.
 void setTypeFromSample(java.lang.String aSample)
          Sets property type from sample string - tries to discern whether string represents a date or number.
 java.lang.String toString()
          Returns a string representation of this property (its name).
 com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver)
          XML archival.
 java.lang.Object valueOf(java.lang.String aString)
          Converts xml attribute string to a specific type.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_STRING

public static final java.lang.String TYPE_STRING
See Also:
Constant Field Values

TYPE_NUMBER

public static final java.lang.String TYPE_NUMBER
See Also:
Constant Field Values

TYPE_DATE

public static final java.lang.String TYPE_DATE
See Also:
Constant Field Values

TYPE_BOOLEAN

public static final java.lang.String TYPE_BOOLEAN
See Also:
Constant Field Values

TYPE_BINARY

public static final java.lang.String TYPE_BINARY
See Also:
Constant Field Values

TYPE_LIST

public static final java.lang.String TYPE_LIST
See Also:
Constant Field Values

TYPE_MAP

public static final java.lang.String TYPE_MAP
See Also:
Constant Field Values

TYPE_OTHER

public static final java.lang.String TYPE_OTHER
See Also:
Constant Field Values
Constructor Detail

RMProperty

public RMProperty()
Creates an uninitialized property.


RMProperty

public 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 Detail

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 java.lang.String getType()
Returns the type of this property.


setType

public void setType(java.lang.String aType)
Sets the type of this property.


setTypeFromSample

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


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.


getSQLType

public int getSQLType()
Returns the SQL type (one of java.sql.Types).


setSQLType

public void setSQLType(int aType)
Sets the SQL type (one of java.sql.Types).


getSQLTypeString

public java.lang.String getSQLTypeString()
Returns the SQL type as a string.


getType

public static java.lang.String getType(int anSQLType)
Returns the RMProperty type for an SQL type.


getSQLType

public static int getSQLType(java.lang.String aPropertyType)
Returns the default SQL type for a given property type.


getSQLTypes

public static int[] getSQLTypes(java.lang.String aPropertyType)
Returns the default SQL types for a given property type.


getSQLTypeString

public static java.lang.String getSQLTypeString(int sqlType)
Returns the string for a given sql type.


isValidTypeSQLTypePair

public static boolean isValidTypeSQLTypePair(java.lang.String aPropertyType,
                                             int sqlType)
Returns whether given RMProperty-type/sql-type pair is valid.


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.


getFormat

public java.text.Format getFormat()
Returns format for this property.


setFormat

public void setFormat(java.text.Format aFormat)
Sets the format.


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.


getNextUniqueId

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


getMetaData

public java.lang.Object getMetaData(java.lang.String aName)
Returns a meta data value for a name.


setMetaData

public void setMetaData(java.lang.String aName,
                        java.lang.Object aValue)
Sets a meta data value for a name.


setMetaDataValueClass

public static void setMetaDataValueClass(java.lang.String aName,
                                         java.lang.Class aClass)
Sets a metadata type.


valueOf

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


equals

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

Overrides:
equals in class java.lang.Object

clone

public java.lang.Object clone()
Standard clone implementation.

Overrides:
clone in class java.lang.Object

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)
XML archival.


fromXML

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


ReportMill 10 API