com.ihr.xbrl.util
Class AttributeFilter

java.lang.Object
  extended by com.ihr.xbrl.util.AttributeFilter
All Implemented Interfaces:
java.util.Iterator<XBRLAttribute>

public abstract class AttributeFilter
extends java.lang.Object
implements java.util.Iterator<XBRLAttribute>

This class is abstract and serves for XBRL defined objects to remove from the declared attributes in the node all that belongs to a different layer as for example the XML Schema layer or the XLink layer.

Using this class each object will return the set of attributes that belongs to the object as expected.

Since:
2.6.4
Author:
Ignacio

Constructor Summary
AttributeFilter(java.util.Iterator<XBRLAttribute> notFilteredIter, javax.xml.namespace.QName[] exceptions)
          Creates a new instance of an AttributeFilter.
 
Method Summary
 javax.xml.namespace.QName[] getExceptions()
          Access to the list of exceptions initialized for this AttributeFilter
 boolean hasNext()
           
 XBRLAttribute next()
           
 void remove()
           
abstract  boolean shouldBeSkiped(XBRLAttribute at)
          Returns true if the attribute indicated in the parameter should not be returned by this Iterator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeFilter

public AttributeFilter(java.util.Iterator<XBRLAttribute> notFilteredIter,
                       javax.xml.namespace.QName[] exceptions)
Creates a new instance of an AttributeFilter.

The AttributeFilter will check if the attributes are in the list of QNames passed in as the array of exceptions. If the attribute node names is not in the list then the abstract method shouldBeSkiped is called.

If the exceptions is null, shouldBySkiped is always called.

Parameters:
notFilteredIter - surrounding attribute iterator. Can be another Attribute filter.
exceptions - static array of QNames that will be skipped by this filter or null.
Method Detail

shouldBeSkiped

public abstract boolean shouldBeSkiped(XBRLAttribute at)
Returns true if the attribute indicated in the parameter should not be returned by this Iterator

Parameters:
at -
Returns:
boolean

getExceptions

public javax.xml.namespace.QName[] getExceptions()
Access to the list of exceptions initialized for this AttributeFilter

Returns:
Array of QNames

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<XBRLAttribute>

next

public XBRLAttribute next()
Specified by:
next in interface java.util.Iterator<XBRLAttribute>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<XBRLAttribute>


Copyright 2006-2009 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa