sk.uniba.euromath.document
Class AttributesFilter

java.lang.Object
  extended by sk.uniba.euromath.document.AttributesFilter
All Implemented Interfaces:
Attributes

public class AttributesFilter
extends Object
implements Attributes

Wrapper of attribute list; from DOM NamedNodeMap to SAX Attributes interface. This class hides the emp:id attribute and all attributes, which qname begins with "xml" string.

Warning: if NamedNodeMap is modified after creating this instance, you must create new instance of this class. Otherwise it will not work properly.

Clients may subclass and/or instantiate the class.

Author:
Martin Vysny

Field Summary
 List<Attr> attrs
          List of regular attributes, reflects state of this object.
 NamedNodeMap attrsMap
          Wrapped attributes.
 
Constructor Summary
AttributesFilter(NamedNodeMap attributes)
          Constructor.
 
Method Summary
 int getIndex(String qName)
           
 int getIndex(String uri, String localName)
           
 int getLength()
           
 String getLocalName(int index)
           
 int getOriginalIndex(int i)
          Returns index in original NamedNodeMap from this index.
 String getQName(int index)
           
 String getType(int index)
           
 String getType(String qName)
           
 String getType(String uri, String localName)
           
 String getURI(int index)
           
 String getValue(int index)
           
 String getValue(String qName)
           
 String getValue(String uri, String localName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attrs

public final List<Attr> attrs
List of regular attributes, reflects state of this object.


attrsMap

public final NamedNodeMap attrsMap
Wrapped attributes.

Constructor Detail

AttributesFilter

public AttributesFilter(NamedNodeMap attributes)
Constructor.

Parameters:
attributes - wrapped attributes. must not be null.
Method Detail

getIndex

public int getIndex(String uri,
                    String localName)
Specified by:
getIndex in interface Attributes

getIndex

public int getIndex(String qName)
Specified by:
getIndex in interface Attributes

getLength

public int getLength()
Specified by:
getLength in interface Attributes

getLocalName

public String getLocalName(int index)
Specified by:
getLocalName in interface Attributes

getQName

public String getQName(int index)
Specified by:
getQName in interface Attributes

getType

public String getType(int index)
Specified by:
getType in interface Attributes

getType

public String getType(String uri,
                      String localName)
Specified by:
getType in interface Attributes

getType

public String getType(String qName)
Specified by:
getType in interface Attributes

getURI

public String getURI(int index)
Specified by:
getURI in interface Attributes

getValue

public String getValue(int index)
Specified by:
getValue in interface Attributes

getValue

public String getValue(String uri,
                       String localName)
Specified by:
getValue in interface Attributes

getValue

public String getValue(String qName)
Specified by:
getValue in interface Attributes

getOriginalIndex

public int getOriginalIndex(int i)
Returns index in original NamedNodeMap from this index. These two may differ because some attributes are not returnable in this class (those, for which isRegularAttribute returns false).

Parameters:
i - index to this object (attrs list).
Returns:
index in original attributes.


Copyright © 2003-2006 null. All Rights Reserved.