net.sf.jsefa.xml.lowlevel.model
Class ElementStartImpl

java.lang.Object
  extended by net.sf.jsefa.xml.lowlevel.model.ElementStartImpl
All Implemented Interfaces:
ElementStart, XmlItem

public final class ElementStartImpl
extends Object
implements ElementStart

Implementation of ElementStart.

For performance reason no defensive copy of the attributes is made. A new instance of ElementStartImpl takes control of the given array of attributes. Furthermore getAttributes() directly returns this list - no copy or view is created. Thus a client must not change the array of attributes after creating a new ElementStartImpl and must not change the result of getAttributes().

Respecting this an instance of this class is thread-safe.

Author:
Norman Lahme-Huetig

Constructor Summary
ElementStartImpl(QName name, QName dataTypeName, Attribute[] attributes, int depth)
          Constructs a new ElementStartImpl.
 
Method Summary
 Attribute[] getAttributes()
          Returns the attributes of the xml element.
 QName getDataTypeName()
          Returns the name of the datatype of the xml element.
 int getDepth()
          Returns the depth of this element.
 QName getName()
          Returns the name of the xml element.
 XmlItemType getType()
          Returns the type of this xml item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementStartImpl

public ElementStartImpl(QName name,
                        QName dataTypeName,
                        Attribute[] attributes,
                        int depth)
Constructs a new ElementStartImpl.

Note: the new ElementStartImpl takes control of the given attributes list; it makes no defensive copy of it.

Parameters:
name - the name of the element
dataTypeName - the data type name
attributes - the list of attributes.
depth - the depth of the element in the element tree.
Method Detail

getName

public QName getName()
Returns the name of the xml element.

Specified by:
getName in interface ElementStart
Returns:
the name of the xml element

getDataTypeName

public QName getDataTypeName()
Returns the name of the datatype of the xml element.

Specified by:
getDataTypeName in interface ElementStart
Returns:
the name of the datatype of the xml element

getAttributes

public Attribute[] getAttributes()
Returns the attributes of the xml element.

Specified by:
getAttributes in interface ElementStart
Returns:
the attributes.

getDepth

public int getDepth()
Returns the depth of this element.

The depth of the root element is 0.

Specified by:
getDepth in interface ElementStart
Returns:
the depth of this element

getType

public XmlItemType getType()
Returns the type of this xml item.

Specified by:
getType in interface XmlItem
Returns:
the type of this xml item


Copyright © 2014. All rights reserved.