Style Intelligence v12.0

inetsoft.uql.erm
Class XEntity

java.lang.Object
  extended by inetsoft.uql.erm.XEntity
All Implemented Interfaces:
Serializable, Cloneable, Comparable

public class XEntity
extends Object
implements Cloneable, Serializable, Comparable

An XEntity represents a business logic object in a data model. Entities contain a collection of attributes which describe that object.

Since:
4.4
See Also:
Serialized Form

Field Summary
static String DESCRIPTION
          Property name of the description of an entity.
static String LOCATION
          Property name of the location of an entity.
static String NAME
          Property name of the name of an entity.
 
Constructor Summary
XEntity()
          Creates a new instance of XEntity.
XEntity(String name)
          Creates a new instance of XEntity with the specified name.
XEntity(XEntity base)
          Creates a new instance of XEntity with the specified name.
 
Method Summary
 void addAttribute(int idx, XAttribute attribute)
          Add the attribute at the specified position.
 void addAttribute(XAttribute attribute)
          Adds the specified attribute to this entity.
 void addPropertyChangeListener(PropertyChangeListener l)
          Add a listener that is notified when a property of this entity has been changed.
 Object clone()
          Creates and returns a copy of this entity object.
 int compareTo(Object obj)
          Compare the entities by name.
 boolean containsAttribute(String name)
          Check if contains an attribute.
 boolean containsColumn(String table, String column)
          Determines if this entity contains an attribute that is mapped to the specified column.
 boolean equals(Object obj)
           
 XAttribute getAttribute(String name)
          Gets the attribute of this entity with the specified name.
 XAttribute getAttributeAt(int idx)
          Get the attribute at the specified index.
 int getAttributeCount()
          Get the number of attributes contained in this entity.
 int getAttributeIndex(String name)
          Get the position of the attribute within the entity.
 Enumeration getAttributes()
          Gets all attributes contained in this entity.
 XEntity getBaseEntity()
          Get base entity.
 String getDescription()
          Gets a description of this entity.
 Point getLocation()
          Gets the location at which this entity should be rendered in the data model designer.
 String getName()
          Gets the name of this entity.
 int hashCode()
          Returns a hash code value for the object.
 boolean isAttributeVisible(String name)
          Check the specified attribute is visible or not.
 boolean isBaseAttribute(String name)
          Check if the specified attribute is from base entity.
 boolean isBaseEntity()
          Check if is base entity.
 boolean isMappedToColumn(String table, String column)
          Determine if any of the attributes in this entity are mapped to the specified column.
 boolean isMappedToTable(String table)
          Determine if any of the attributes in this entity are mapped to the specified table.
 boolean isVisible()
          Check this entity is visible or not.
 boolean moveAttribute(String name, boolean up)
          move up or down the attribute with the specified name.
 void parseXML(Element tag)
          Reads in an entity definition from its XML representation.
 void removeAllPropertyChangeListeners()
          Removes all registered property change listeners from the notification list.
 void removeAttribute(String name)
          Removes the attribute with the specified name from this entity.
 void removePropertyChangeListener(PropertyChangeListener l)
          Remove a property change listener from the notification list.
 void setAttributeVisible(String name, boolean visible)
          Set the specified attribute is visible or not.
 void setBaseEntity(XEntity base)
          Set base entity.
 void setDescription(String description)
          Sets the description for this entity.
 void setLocation(Point location)
          Sets the location at which this entity should be rendered in the data model designer.
 void setName(String name)
          Sets the name of this entity.
 void setRuntime(boolean runtime)
          Set is runtime mode or not.
 void setVisible(boolean visible)
          Set this entity is visible or not.
 void sortAttributes()
          Sorts the attributes by their names in alphabetical order.
 String toString()
          Gets a textual representation of this entity.
 void updateAttribute(String oname, XAttribute attribute)
          Update an attribute in this entity.
 void validate()
          validate.
protected  void writeXML(PrintWriter writer)
          Writes the XML element representation of this object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
Property name of the name of an entity.

See Also:
Constant Field Values

DESCRIPTION

public static final String DESCRIPTION
Property name of the description of an entity.

See Also:
Constant Field Values

LOCATION

public static final String LOCATION
Property name of the location of an entity.

See Also:
Constant Field Values
Constructor Detail

XEntity

public XEntity()
Creates a new instance of XEntity. Default constructor that should only be used when loading the entity from an XML file.


XEntity

public XEntity(String name)
Creates a new instance of XEntity with the specified name.

Parameters:
name - a human readable name for the entity. The name should allow a user to infer the entity's usage.

XEntity

public XEntity(XEntity base)
Creates a new instance of XEntity with the specified name.

Parameters:
base - the base entity.
Method Detail

setName

public void setName(String name)
Sets the name of this entity. The name should be in a human-readable format and allow a user to infer its usage.

Parameters:
name - the name of this entity.

getName

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

Returns:
the entity's name.

setDescription

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

Parameters:
description - a description of this entity.

getDescription

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

Returns:
a description of this entity.

addAttribute

public void addAttribute(XAttribute attribute)
Adds the specified attribute to this entity.

Parameters:
attribute - the attribute object to add.

addAttribute

public void addAttribute(int idx,
                         XAttribute attribute)
Add the attribute at the specified position.


isBaseAttribute

public boolean isBaseAttribute(String name)
Check if the specified attribute is from base entity.


updateAttribute

public void updateAttribute(String oname,
                            XAttribute attribute)
Update an attribute in this entity.

Parameters:
oname - the original name of the attribute.
attribute - the attribute that has been modified.
Since:
6.0

removeAttribute

public void removeAttribute(String name)
Removes the attribute with the specified name from this entity.

Parameters:
name - the name of the attribute to remove.

getAttribute

public XAttribute getAttribute(String name)
Gets the attribute of this entity with the specified name.

Parameters:
name - the name of the attribute to find.
Returns:
the attribute object or null if this entity does not contain an attribute with the specified name.

getAttributeIndex

public int getAttributeIndex(String name)
Get the position of the attribute within the entity.


getAttributes

public Enumeration getAttributes()
Gets all attributes contained in this entity.

Returns:
an Enumeration of XAttribute objects.

containsAttribute

public boolean containsAttribute(String name)
Check if contains an attribute.

Parameters:
name - the specified attribute name.
Returns:
true if contains, false otherwise.

getAttributeCount

public int getAttributeCount()
Get the number of attributes contained in this entity.

Returns:
the number of attributes contained in this entity.

getAttributeAt

public XAttribute getAttributeAt(int idx)
Get the attribute at the specified index.

Parameters:
idx - the index of the attribute.
Returns:
the requested attribute.

moveAttribute

public boolean moveAttribute(String name,
                             boolean up)
move up or down the attribute with the specified name.

Parameters:
name - the name of the attribute to move.
up - the direction true: up.

sortAttributes

public void sortAttributes()
Sorts the attributes by their names in alphabetical order.

Since:
8.0

containsColumn

public boolean containsColumn(String table,
                              String column)
Determines if this entity contains an attribute that is mapped to the specified column.

Parameters:
table - the name of the table.
column - the name of the column.

isBaseEntity

public boolean isBaseEntity()
Check if is base entity.


getLocation

public Point getLocation()
Gets the location at which this entity should be rendered in the data model designer.

Returns:
the upper-left corner of this entity.

setLocation

public void setLocation(Point location)
Sets the location at which this entity should be rendered in the data model designer.

Parameters:
location - the upper-left corner of this entity.

writeXML

protected 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

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

Parameters:
tag - the XML Element for this object.
Throws:
Exception

toString

public String toString()
Gets a textual representation of this entity. 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 XEntity: entity name.

clone

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

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

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.

equals

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

compareTo

public int compareTo(Object obj)
Compare the entities by name.

Specified by:
compareTo in interface Comparable

isMappedToTable

public boolean isMappedToTable(String table)
Determine if any of the attributes in this entity are mapped to the specified table.

Parameters:
table - the name of the table.
Returns:
true if this entity contains a mapping to the specified table; false otherwise.

isMappedToColumn

public boolean isMappedToColumn(String table,
                                String column)
Determine if any of the attributes in this entity are mapped to the specified column.

Parameters:
table - the name of the table.
column - the name of the column.
Returns:
true if this entity contains a mapping to the specified column; false otherwise.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Add a listener that is notified when a property of this entity has been changed.

Parameters:
l - the listener to add.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Remove 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.


setBaseEntity

public void setBaseEntity(XEntity base)
Set base entity.


getBaseEntity

public XEntity getBaseEntity()
Get base entity.


validate

public void validate()
validate.


setRuntime

public void setRuntime(boolean runtime)
Set is runtime mode or not.


isAttributeVisible

public boolean isAttributeVisible(String name)
Check the specified attribute is visible or not.

Parameters:
name - the name of the specified attribute.

setAttributeVisible

public void setAttributeVisible(String name,
                                boolean visible)
Set the specified attribute is visible or not.

Parameters:
name - the name of the specified attribute.

isVisible

public boolean isVisible()
Check this entity is visible or not.


setVisible

public void setVisible(boolean visible)
Set this entity is visible or not.


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