com.metamatrix.query.mapping.xml
Class MappingElement

java.lang.Object
  extended by com.metamatrix.query.mapping.xml.MappingNode
      extended by com.metamatrix.query.mapping.xml.MappingBaseNode
          extended by com.metamatrix.query.mapping.xml.MappingElement
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
MappingRecursiveElement

public class MappingElement
extends MappingBaseNode

A Mapping Node which defines a Element in XML Schema Mapping document

See Also:
Serialized Form

Constructor Summary
MappingElement(java.lang.String name)
           
MappingElement(java.lang.String name, Namespace namespace)
           
MappingElement(java.lang.String name, java.lang.String nameInSource)
           
 
Method Summary
 void acceptVisitor(MappingVisitor visitor)
           
 MappingElement addAttribute(MappingAttribute attr)
          Adds the attribute node to the current node and returns the current node
 MappingCommentNode addCommentNode(MappingCommentNode elem)
          Adds a comment node to the current element and returns the added child node
 void addNamespace(Namespace space)
           
 MappingElement addSibilingElement(MappingElement elem)
          Adds a sibiling node to the current node and returns the added sibiling node;
 java.util.List getAttributes()
          Get all the attributes on this Node
 java.lang.String getDefaultValue()
           
 ElementSymbol getElementSymbol()
           
 java.lang.String getName()
          Name of the node
 java.lang.String getNameInSource()
           
 Namespace getNamespace()
           
 java.lang.String getNamespacePrefix()
          Namespace prefix
 Namespace[] getNamespaces()
          Namespaces to be decalred
 java.util.Properties getNamespacesAsProperties()
           
 java.lang.String getNormalizeText()
           
 MappingSourceNode getSourceNode()
          Get the source node for this Mapping Node; note that only mapping elements and mapping attributes have the source nodes; that too ones with specified with NameInSource specified attribute.
 java.lang.String getType()
           
 java.lang.String getValue()
           
 boolean hasAttributes()
           
 boolean isAlwaysInclude()
           
 boolean isNillable()
           
 boolean isOptional()
           
 boolean isRecursive()
          true if this element is recursive element; false otherwise
 boolean isTagRoot()
          A tag root node is the first visual node (Element to be specific) in the document tree which is the root element in the output xml document.
 void removeAttribute(MappingAttribute toRemove)
          Remove attribute node from element
 MappingElement setAlwaysInclude(boolean include)
           
 MappingElement setDefaultValue(java.lang.String value)
           
 void setElementSymbol(ElementSymbol symbol)
           
 MappingElement setNameInSource(java.lang.String srcName)
           
 void setNamespaces(Namespace[] spaces)
          Declare the namespaces on the element.
 MappingElement setNillable(boolean nil)
           
 MappingElement setNormalizeText(java.lang.String normalize)
           
 MappingElement setOptional(boolean optional)
           
 MappingElement setType(java.lang.String type)
           
 MappingElement setValue(java.lang.String value)
           
 
Methods inherited from class com.metamatrix.query.mapping.xml.MappingBaseNode
addAllNode, addChildElement, addChoiceNode, addCriteriaNode, addSequenceNode, addSourceNode, addStagingTable, getCanonicalName, getDocument, getMaxOccurence, getMinOccurence, getParentNode, getRecursionId, getSource, getStagingTables, isDocumentNode, isRootRecursiveNode, removeChildNode, setMaxOccurrs, setMinOccurrs, setSource, setStagingTables
 
Methods inherited from class com.metamatrix.query.mapping.xml.MappingNode
addChild, equals, findNode, getChildren, getChildren, getFullyQualifiedName, getNodeChildren, getNodeProperties, getParent, getPathName, getProperty, hashCode, isExcluded, printMappingNodeTree, setExclude, toString, toStringNodeTree
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MappingElement

public MappingElement(java.lang.String name)

MappingElement

public MappingElement(java.lang.String name,
                      java.lang.String nameInSource)

MappingElement

public MappingElement(java.lang.String name,
                      Namespace namespace)
Method Detail

acceptVisitor

public void acceptVisitor(MappingVisitor visitor)
Specified by:
acceptVisitor in class MappingNode

getNamespace

public Namespace getNamespace()

setNameInSource

public MappingElement setNameInSource(java.lang.String srcName)

setNillable

public MappingElement setNillable(boolean nil)

setDefaultValue

public MappingElement setDefaultValue(java.lang.String value)

setValue

public MappingElement setValue(java.lang.String value)

setOptional

public MappingElement setOptional(boolean optional)

setNormalizeText

public MappingElement setNormalizeText(java.lang.String normalize)

setType

public MappingElement setType(java.lang.String type)

setAlwaysInclude

public MappingElement setAlwaysInclude(boolean include)

addCommentNode

public MappingCommentNode addCommentNode(MappingCommentNode elem)
Adds a comment node to the current element and returns the added child node


addAttribute

public MappingElement addAttribute(MappingAttribute attr)
Adds the attribute node to the current node and returns the current node


addSibilingElement

public MappingElement addSibilingElement(MappingElement elem)
Adds a sibiling node to the current node and returns the added sibiling node;

Parameters:
elem -

removeAttribute

public void removeAttribute(MappingAttribute toRemove)
Remove attribute node from element

Parameters:
toRemove -

setNamespaces

public void setNamespaces(Namespace[] spaces)
Declare the namespaces on the element.


addNamespace

public void addNamespace(Namespace space)

getAttributes

public java.util.List getAttributes()
Get all the attributes on this Node

Returns:
empty list if not found any attributes

hasAttributes

public boolean hasAttributes()

isRecursive

public boolean isRecursive()
true if this element is recursive element; false otherwise


getName

public java.lang.String getName()
Name of the node

Overrides:
getName in class MappingBaseNode
Returns:

getNamespacePrefix

public java.lang.String getNamespacePrefix()
Namespace prefix

Returns:

getNamespaces

public Namespace[] getNamespaces()
Namespaces to be decalred

Returns:

getNamespacesAsProperties

public java.util.Properties getNamespacesAsProperties()

getNameInSource

public java.lang.String getNameInSource()
Overrides:
getNameInSource in class MappingNode

isNillable

public boolean isNillable()

getDefaultValue

public java.lang.String getDefaultValue()

getValue

public java.lang.String getValue()

isOptional

public boolean isOptional()

getNormalizeText

public java.lang.String getNormalizeText()

getType

public java.lang.String getType()

isAlwaysInclude

public boolean isAlwaysInclude()

isTagRoot

public boolean isTagRoot()
Description copied from class: MappingBaseNode
A tag root node is the first visual node (Element to be specific) in the document tree which is the root element in the output xml document.

Overrides:
isTagRoot in class MappingBaseNode
Returns:
true if
See Also:
MappingBaseNode.isTagRoot()

setElementSymbol

public void setElementSymbol(ElementSymbol symbol)

getElementSymbol

public ElementSymbol getElementSymbol()

getSourceNode

public MappingSourceNode getSourceNode()
Description copied from class: MappingNode
Get the source node for this Mapping Node; note that only mapping elements and mapping attributes have the source nodes; that too ones with specified with NameInSource specified attribute. If not find nearest one looking up the tree.

Overrides:
getSourceNode in class MappingNode
Returns:
See Also:
MappingNode.getSourceNode()


Copyright © 2009. All Rights Reserved.