Style Intelligence v12.0

inetsoft.uql.erm
Class XAttribute

java.lang.Object
  extended by inetsoft.uql.erm.XAttribute
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
ExpressionAttribute

public class XAttribute
extends Object
implements Cloneable, Serializable

An XAttribute represents an attribute of an entity in a data model. Every XAttribute is mapped to a single column in the data source. Additionally, the data type for the attribute can be specified.

Since:
4.4
See Also:
Serialized Form

Field Summary
static String BROWSE_DATA_QUERY
          Property name for the name of the browse data query.
static String BROWSEABLE
          Property name for the browseable property.
static String DATA_TYPE
          Property name of the data type of the attribute.
static String DESCRIPTION
          Property name for the description of the attribute.
static String MAPPED_COLUMN
          Property name of the mapped column of the attribute.
static String META_DATA
          Property name of the meta data of the attribute.
static String NAME
          Property name for the name of the attribute.
 
Constructor Summary
XAttribute(String name, String table, String column)
          Creates a new instance of XAttribute with a default data type of String.
XAttribute(String name, String table, String column, String type)
          Creates a new instance of XAttribute with the specified data type.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          Adds a listener that is notified when a property of this attribute is changed.
 Object clone()
          Creates and returns a copy of this attribute object.
 boolean equals(Object obj)
           
 String getBrowseDataQuery()
          Get the query to use for retrieve a list of values for Browse Data.
 String getColumn()
          Get the name of the database column this attribute is mapped to.
 String[] getColumns()
          Ge the full name of all datatable columns referenced by this attribute.
 String getDataType()
          Gets the data type of this attribute.
 String getDefaultFormula()
          Get the default formula.
 String getDescription()
          Gets a description of this attribute.
 String getName()
          Gets the name of this attribute.
 int getRefType()
          Get the ref type.
 String getTable()
          Gets the name of the database table this attribute is mapped to.
 String[] getTables()
          Gets the name of all database tables referenced by this attribute.
 XMetaInfo getXMetaInfo()
          Get the meta data of this attribute.
 boolean isBrowseable()
          Check if this attribute can be browsed.
 boolean isExpression()
          Check if the attribute is an expression.
 void mapToColumn(String table, String column)
          Maps this attribute to the specified column in the data source.
protected  void parseXML(Element tag)
          Reads in an attribute definition from its XML representation.
 void removeAllPropertyChangeListeners()
          Removes all registered property change listeners from the notification list.
 void removePropertyChangeListener(PropertyChangeListener l)
          Removes a property change listener from the notification list.
 void setBrowseable(boolean browse)
          Set whether this attribute can be browsed by end user.
 void setBrowseDataQuery(String query)
          Set the query to use for retrieve a list of values for Browse Data.
 void setDataType(String type)
          Sets the data type of this attribute.
 void setDefaultFormula(String formula)
          Set the default formula.
 void setDescription(String description)
          Sets the description for this attribute.
 void setName(String name)
          Sets the name of this attribute.
 void setRefType(int refType)
          Set the ref type.
 void setXMetaInfo(XMetaInfo meta)
          Sets the meta data type of this attribute.
 String toString()
          Gets a textual representation of this attribute.
 void writeXML(PrintWriter writer)
          Writes the XML element representation of this object.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
Property name for the name of the attribute.

See Also:
Constant Field Values

BROWSE_DATA_QUERY

public static final String BROWSE_DATA_QUERY
Property name for the name of the browse data query.

See Also:
Constant Field Values

BROWSEABLE

public static final String BROWSEABLE
Property name for the browseable property.

See Also:
Constant Field Values

DESCRIPTION

public static final String DESCRIPTION
Property name for the description of the attribute.

See Also:
Constant Field Values

DATA_TYPE

public static final String DATA_TYPE
Property name of the data type of the attribute.

See Also:
Constant Field Values

MAPPED_COLUMN

public static final String MAPPED_COLUMN
Property name of the mapped column of the attribute.

See Also:
Constant Field Values

META_DATA

public static final String META_DATA
Property name of the meta data of the attribute.

See Also:
Constant Field Values
Constructor Detail

XAttribute

public XAttribute(String name,
                  String table,
                  String column)
Creates a new instance of XAttribute with a default data type of String.

Parameters:
name - the name of this attribute. The name should be in a human readable format and allow a user to infer its meaning and useage.
table - the name of the database table this attribute maps into.
column - the name of the database column this attribute maps into.

XAttribute

public XAttribute(String name,
                  String table,
                  String column,
                  String type)
Creates a new instance of XAttribute with the specified data type.

Parameters:
name - the name of this attribute. The name should be in a human readable format and allow a user to infer its meaning and useage.
table - the name of the database table this attribute maps into.
column - the name of the database column this attribute maps into.
type - the data type of this attribute. Must be one of the data type constants defined in XSchema.
Method Detail

setName

public void setName(String name)
Sets the name of this attribute. The name should be a human readable and allow the user to infer the attributes usage.

Parameters:
name - the name of the attribute.

getName

public String getName()
Gets the name of this attribute.

Returns:
the name of this attribute.

isExpression

public boolean isExpression()
Check if the attribute is an expression.

Returns:
true if is an expression, false otherwise.

setBrowseDataQuery

public void setBrowseDataQuery(String query)
Set the query to use for retrieve a list of values for Browse Data.

Parameters:
query - the name of the query.

getBrowseDataQuery

public String getBrowseDataQuery()
Get the query to use for retrieve a list of values for Browse Data.

Returns:
the name of the query.

setBrowseable

public void setBrowseable(boolean browse)
Set whether this attribute can be browsed by end user. By default it's true. If this attribute is in a very large table, this property can be turned off to avoid excessive long queries.

Parameters:
browse - true if this attribute is browsable.

isBrowseable

public boolean isBrowseable()
Check if this attribute can be browsed.

Returns:
true if this attribute is browsable.

setDescription

public void setDescription(String description)
Sets the description for this attribute. The description should tell a user the intended usage of this attribute and the type of information it provides.

Parameters:
description - a description of this attribute.

getDescription

public String getDescription()
Gets a description of this attribute. The description contains information on the intended usage of this attribute and the type of data it provides.

Returns:
a description of this attribute.

mapToColumn

public void mapToColumn(String table,
                        String column)
Maps this attribute to the specified column in the data source.

Parameters:
table - the name of the table to map into.
column - the name of the column to map into.

getTable

public String getTable()
Gets the name of the database table this attribute is mapped to.

Returns:
the name of a database table.

getColumn

public String getColumn()
Get the name of the database column this attribute is mapped to.

Returns:
the name of a database column.

getTables

public String[] getTables()
Gets the name of all database tables referenced by this attribute.

Returns:
an array of String objects that always contains the result of getTable().

getColumns

public String[] getColumns()
Ge the full name of all datatable columns referenced by this attribute.


setDataType

public void setDataType(String type)
Sets the data type of this attribute. Values must be one of the data type constants defined in XSchema.

Parameters:
type - the data type.

getDataType

public String getDataType()
Gets the data type of this attribute.

Returns:
one of the data type constants defined in XSchema

setXMetaInfo

public void setXMetaInfo(XMetaInfo meta)
Sets the meta data type of this attribute.

Parameters:
meta - the meta data.

getXMetaInfo

public XMetaInfo getXMetaInfo()
Get the meta data of this attribute.

Returns:
the meta data.

writeXML

public void writeXML(PrintWriter writer)
Writes the XML element representation of this object.

Parameters:
writer - the output stream to which to write the XML data.

parseXML

protected void parseXML(Element tag)
                 throws Exception
Reads in an attribute definition from its XML representation.

Parameters:
tag - the XML Element for this object.
Throws:
Exception - if an error occurs while parsing the XML element.

toString

public String toString()
Gets a textual representation of this attribute. For user interface purposes use the getName() method.

Overrides:
toString in class Object
Returns:
a string representation of this object. This value will have the format XAttribute: attribute name.

clone

public Object clone()
Creates and returns a copy of this attribute object.

Overrides:
clone in class Object
Returns:
a clone of this instance.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Adds a listener that is notified when a property of this attribute is changed.

Parameters:
l - the listener to add.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Removes a property change listener from the notification list.

Parameters:
l - the listener to remove.

removeAllPropertyChangeListeners

public void removeAllPropertyChangeListeners()
Removes all registered property change listeners from the notification list.


setRefType

public void setRefType(int refType)
Set the ref type.


getRefType

public int getRefType()
Get the ref type.

Returns:
the ref type, one of NONE, DIMENSION and MEASURE.

getDefaultFormula

public String getDefaultFormula()
Get the default formula.


setDefaultFormula

public void setDefaultFormula(String formula)
Set the default formula.


Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.