FileDocCategorySizeDatePackage
XPath2FilterContainer04.javaAPI DocJava SE 6 API8476Tue Jun 10 00:23:04 BST 2008com.sun.org.apache.xml.internal.security.transforms.params

XPath2FilterContainer04

public class XPath2FilterContainer04 extends ElementProxy implements TransformParam
Implements the parameters for the XPath Filter v2.0.
author
$Author: raul $
see
XPath Filter v2.0 (TR)
see
XPath Filter v2.0 (editors copy)

Fields Summary
private static final String
_ATT_FILTER
Field _ATT_FILTER
private static final String
_ATT_FILTER_VALUE_INTERSECT
Field _ATT_FILTER_VALUE_INTERSECT
private static final String
_ATT_FILTER_VALUE_SUBTRACT
Field _ATT_FILTER_VALUE_SUBTRACT
private static final String
_ATT_FILTER_VALUE_UNION
Field _ATT_FILTER_VALUE_UNION
public static final String
_TAG_XPATH2
Field _TAG_XPATH2
public static final String
XPathFilter2NS
Field XPathFiler2NS
Constructors Summary
private XPath2FilterContainer04()
Constructor XPath2FilterContainer04


         
     

      // no instantiation
   
private XPath2FilterContainer04(Document doc, String xpath2filter, String filterType)
Constructor XPath2FilterContainer04

param
doc
param
xpath2filter
param
filterType


      super(doc);

      this._constructionElement.setAttributeNS(null, XPath2FilterContainer04._ATT_FILTER,
                                             filterType);

      if ((xpath2filter.length() > 2)
              && (!Character.isWhitespace(xpath2filter.charAt(0)))) {
         this._constructionElement.appendChild(doc.createTextNode("\n"
                 + xpath2filter + "\n"));
      } else {
         this._constructionElement
            .appendChild(doc.createTextNode(xpath2filter));
      }
   
private XPath2FilterContainer04(Element element, String BaseURI)
Constructor XPath2FilterContainer04

param
element
param
BaseURI
throws
XMLSecurityException


      super(element, BaseURI);

      String filterStr =
         this._constructionElement
            .getAttributeNS(null, XPath2FilterContainer04._ATT_FILTER);

      if (!filterStr
              .equals(XPath2FilterContainer04
              ._ATT_FILTER_VALUE_INTERSECT) &&!filterStr
                 .equals(XPath2FilterContainer04
                 ._ATT_FILTER_VALUE_SUBTRACT) &&!filterStr
                    .equals(XPath2FilterContainer04._ATT_FILTER_VALUE_UNION)) {
         Object exArgs[] = { XPath2FilterContainer04._ATT_FILTER, filterStr,
                             XPath2FilterContainer04._ATT_FILTER_VALUE_INTERSECT
                             + ", "
                             + XPath2FilterContainer04._ATT_FILTER_VALUE_SUBTRACT
                             + " or "
                             + XPath2FilterContainer04._ATT_FILTER_VALUE_UNION };

         throw new XMLSecurityException("attributeValueIllegal", exArgs);
      }
   
Methods Summary
public final java.lang.StringgetBaseLocalName()

inheritDoc

      return XPath2FilterContainer04._TAG_XPATH2;
   
public final java.lang.StringgetBaseNamespace()

inheritDoc

      return XPath2FilterContainer04.XPathFilter2NS;
   
public java.lang.StringgetXPathFilterStr()
Returns the XPath 2 Filter String

return
the XPath 2 Filter String

      return this.getTextFromTextChild();
   
public org.w3c.dom.NodegetXPathFilterTextNode()
Returns the first Text node which contains information from the XPath 2 Filter String. We must use this stupid hook to enable the here() function to work. $todo$ I dunno whether this crashes: here()/ds:Signature[1]

return
the first Text node which contains information from the XPath 2 Filter String

      NodeList children = this._constructionElement.getChildNodes();
      int length = children.getLength();

      for (int i = 0; i < length; i++) {
         if (children.item(i).getNodeType() == Node.TEXT_NODE) {
            return children.item(i);
         }
      }

      return null;
   
public booleanisIntersect()
Returns true if the Filter attribute has value "intersect".

return
true if the Filter attribute has value "intersect".


      return this._constructionElement
         .getAttributeNS(null, XPath2FilterContainer04._ATT_FILTER)
         .equals(XPath2FilterContainer04._ATT_FILTER_VALUE_INTERSECT);
   
public booleanisSubtract()
Returns true if the Filter attribute has value "subtract".

return
true if the Filter attribute has value "subtract".


      return this._constructionElement
         .getAttributeNS(null, XPath2FilterContainer04._ATT_FILTER)
         .equals(XPath2FilterContainer04._ATT_FILTER_VALUE_SUBTRACT);
   
public booleanisUnion()
Returns true if the Filter attribute has value "union".

return
true if the Filter attribute has value "union".


      return this._constructionElement
         .getAttributeNS(null, XPath2FilterContainer04._ATT_FILTER)
         .equals(XPath2FilterContainer04._ATT_FILTER_VALUE_UNION);
   
public static com.sun.org.apache.xml.internal.security.transforms.params.XPath2FilterContainer04newInstance(org.w3c.dom.Element element, java.lang.String BaseURI)
Creates a XPath2FilterContainer04 from an existing Element; needed for verification.

param
element
param
BaseURI
return
the instance
throws
XMLSecurityException

      return new XPath2FilterContainer04(element, BaseURI);
   
public static com.sun.org.apache.xml.internal.security.transforms.params.XPath2FilterContainer04newInstanceIntersect(org.w3c.dom.Document doc, java.lang.String xpath2filter)
Creates a new XPath2FilterContainer04 with the filter type "intersect".

param
doc
param
xpath2filter
return
the instance


      return new XPath2FilterContainer04(doc, xpath2filter,
                                       XPath2FilterContainer04
                                          ._ATT_FILTER_VALUE_INTERSECT);
   
public static com.sun.org.apache.xml.internal.security.transforms.params.XPath2FilterContainer04newInstanceSubtract(org.w3c.dom.Document doc, java.lang.String xpath2filter)
Creates a new XPath2FilterContainer04 with the filter type "subtract".

param
doc
param
xpath2filter
return
the instance


      return new XPath2FilterContainer04(doc, xpath2filter,
                                       XPath2FilterContainer04
                                          ._ATT_FILTER_VALUE_SUBTRACT);
   
public static com.sun.org.apache.xml.internal.security.transforms.params.XPath2FilterContainer04newInstanceUnion(org.w3c.dom.Document doc, java.lang.String xpath2filter)
Creates a new XPath2FilterContainer04 with the filter type "union".

param
doc
param
xpath2filter
return
the instance


      return new XPath2FilterContainer04(doc, xpath2filter,
                                       XPath2FilterContainer04
                                          ._ATT_FILTER_VALUE_UNION);