Style Intelligence v12.0

inetsoft.uql.schema
Class UserDefinedType

java.lang.Object
  extended by inetsoft.uql.XNode
      extended by inetsoft.uql.schema.XTypeNode
          extended by inetsoft.uql.schema.UserDefinedType
All Implemented Interfaces:
inetsoft.util.XMLSerializable, Serializable, Cloneable, Comparable

public class UserDefinedType
extends XTypeNode

User defined type. A user defined type can be a composite type, which contains other data items.

See Also:
Serialized Form

Field Summary
protected  XTypeNode type
           
 
Fields inherited from class inetsoft.uql.schema.XTypeNode
STAR
 
Fields inherited from class inetsoft.uql.XNode
value
 
Constructor Summary
UserDefinedType()
          Create an user defined type.
UserDefinedType(String name)
          Create an user defined type.
UserDefinedType(String name, XTypeNode[] children)
          Create a user defined type with a list of children.
 
Method Summary
 void addAttribute(XTypeNode attr)
          Add an attribute to the type.
 void addChild(XNode child)
          Add a child to this node.
 Object clone()
          Create a clone of this object.
 XTypeNode clone(String tp)
          Create a primitive type node.
 XTypeNode getAttribute(int idx)
          Get the specified attribute.
 int getAttributeCount()
          Get the number of attributes in this type.
 int getAttributeIndex(XTypeNode attr)
          Get the index of an attribute.
protected  String getAttributeString()
          Get additional attributes string.
 XTypeNode getAttributeType(String name)
          Get the attribute type node with specified name.
 XNode getChild(int idx)
          Get the specified child node.
 int getChildCount()
          Get the number of children under this node.
 int getChildIndex(XNode child)
          Find the index of the child in this node.
 String getFormat()
          Get the format string of this data type.
 String getType()
          Get the type of this node.
 XTypeNode getUserType()
          Get the type of this user node.
 void insertChild(int idx, XNode child)
          Insert a child to this node at the specified position.
 boolean isPrimitive()
          Return true if this is a primitive type.
 XNode newInstance()
          Create a value tree corresponding to the data type defined by this type.
 void removeAllChildren()
          Remove all child in the tree.
 void removeChild(int idx)
          Remove the specified child.
 void removeChild(XNode child)
          Remove the specified child.
 void setAttribute(int index, XTypeNode attr)
          Set an attribute at an index.
 void setChild(int idx, XNode child)
          Set the specified child of this node to the new child.
 void setFormat(String fmt)
          Set the format string for the type.
 void setUserType(XTypeNode type)
          Set the type of this user node.
 void writeTypeXML(PrintWriter writer)
          Write the XML schema specification.
 
Methods inherited from class inetsoft.uql.schema.XTypeNode
addChild, cloneType, compareTo, equals, getMaxOccurs, getMinOccurs, getTypeNode, getXMetaInfo, isCompatible, isDate, isNumber, isTypeNodeExists, newInstance, parseXML, setMaxOccurs, setMinOccurs, setXMetaInfo, toString, writeAttributes, writeTreeXML, writeXML
 
Methods inherited from class inetsoft.uql.XNode
addChild, addr, checkDuplicate, cloneValue, eq, getAttribute, getAttributeNames, getChild, getDefaultFormat, getName, getNode, getParent, getPath, getPath, getValue, getValue, hashCode, isAncestor, removeChild, removeChild, setAttribute, setDefaultFormat, setName, setValue, sort, sort
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected XTypeNode type
Constructor Detail

UserDefinedType

public UserDefinedType()
Create an user defined type.


UserDefinedType

public UserDefinedType(String name)
Create an user defined type.


UserDefinedType

public UserDefinedType(String name,
                       XTypeNode[] children)
Create a user defined type with a list of children.

Method Detail

setUserType

public void setUserType(XTypeNode type)
Set the type of this user node.


getUserType

public XTypeNode getUserType()
Get the type of this user node.


addAttribute

public void addAttribute(XTypeNode attr)
Add an attribute to the type.

Overrides:
addAttribute in class XTypeNode

setAttribute

public void setAttribute(int index,
                         XTypeNode attr)
Set an attribute at an index.

Overrides:
setAttribute in class XTypeNode
Parameters:
index - the specified index
attr - the specified attribute

getAttributeCount

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

Overrides:
getAttributeCount in class XTypeNode

getAttribute

public XTypeNode getAttribute(int idx)
Get the specified attribute.

Overrides:
getAttribute in class XTypeNode

getAttributeIndex

public int getAttributeIndex(XTypeNode attr)
Get the index of an attribute.

Overrides:
getAttributeIndex in class XTypeNode
Parameters:
attr - the specified attribute
Returns:
the index of the specified attribute

getAttributeType

public XTypeNode getAttributeType(String name)
Get the attribute type node with specified name.

Overrides:
getAttributeType in class XTypeNode

getType

public String getType()
Get the type of this node. The types are defined in XSchema class.

Overrides:
getType in class XTypeNode

isPrimitive

public boolean isPrimitive()
Return true if this is a primitive type.

Overrides:
isPrimitive in class XTypeNode

newInstance

public XNode newInstance()
Create a value tree corresponding to the data type defined by this type.

Overrides:
newInstance in class XTypeNode

getChildCount

public int getChildCount()
Get the number of children under this node.

Overrides:
getChildCount in class XNode

getChild

public XNode getChild(int idx)
Get the specified child node.

Overrides:
getChild in class XNode
Parameters:
idx - child index.
Returns:
child node.

getChildIndex

public int getChildIndex(XNode child)
Find the index of the child in this node.

Overrides:
getChildIndex in class XNode

addChild

public void addChild(XNode child)
Add a child to this node.

Overrides:
addChild in class XNode

setChild

public void setChild(int idx,
                     XNode child)
Set the specified child of this node to the new child.

Overrides:
setChild in class XNode

removeChild

public void removeChild(XNode child)
Remove the specified child.

Overrides:
removeChild in class XNode

removeChild

public void removeChild(int idx)
Remove the specified child.

Overrides:
removeChild in class XNode
Parameters:
idx - the index of the child to remove

removeAllChildren

public void removeAllChildren()
Remove all child in the tree.

Overrides:
removeAllChildren in class XNode

insertChild

public void insertChild(int idx,
                        XNode child)
Insert a child to this node at the specified position.

Overrides:
insertChild in class XNode

setFormat

public void setFormat(String fmt)
Set the format string for the type. The meaning of the format depends on the data type. For example, for date related formats, the format string is used to construct a SimpleDateFormat object.

Overrides:
setFormat in class XTypeNode

getFormat

public String getFormat()
Get the format string of this data type.

Overrides:
getFormat in class XTypeNode

getAttributeString

protected String getAttributeString()
Get additional attributes string.

Overrides:
getAttributeString in class XTypeNode

writeTypeXML

public void writeTypeXML(PrintWriter writer)
Write the XML schema specification.

Overrides:
writeTypeXML in class XTypeNode

clone

public Object clone()
Create a clone of this object.

Overrides:
clone in class XTypeNode

clone

public XTypeNode clone(String tp)
Create a primitive type node.

Overrides:
clone in class XTypeNode
Parameters:
tp - one of the primitive types defined in XSchema.

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