Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15
OOoRunner test harness

util
Class XMLTools.Tag

java.lang.Object
  |
  +--util.XMLTools.Tag
Enclosing class:
XMLTools

public static class XMLTools.Tag
extends Object

Represents an XML tag which must be found in XML data written. This tag can contain only its name or tag name and attribute name, or attribute value additionally.


Constructor Summary
XMLTools.Tag(String tagName)
          Creates tag which has only a name.
XMLTools.Tag(String tagName, String attrName)
          Creates a tag with the name specified, which must have an attribute with name specified.
XMLTools.Tag(String tagName, String[] attrNames)
          Creates a tag with the name specified, which must have attributes specified.
XMLTools.Tag(String tagName, String[][] attrValues)
          Creates a tag with the name specified, which must have an attributes with their values specified.
XMLTools.Tag(String tagName, String attrName, String attrValue)
          Creates a tag with the name specified, which must have an attribute with the value specified.
 
Method Summary
protected  boolean checkAttr(int attrListIdx, com.sun.star.xml.sax.XAttributeList list)
           
 boolean isMatchTo(String tagName, com.sun.star.xml.sax.XAttributeList list)
          Checks if this tag matches tag passed in parameters.
 String toString()
          Gets tag String description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLTools.Tag

public XMLTools.Tag(String tagName)
Creates tag which has only a name. Attributes don't make sense.
Parameters:
tagName - The name of the tag.

XMLTools.Tag

public XMLTools.Tag(String tagName,
                    String attrName)
Creates a tag with the name specified, which must have an attribute with name specified. The value of this attribute doesn't make sense.
Parameters:
tagName - The name of the tag.
attrName - The name of attribute which must be contained in the tag.

XMLTools.Tag

public XMLTools.Tag(String tagName,
                    String attrName,
                    String attrValue)
Creates a tag with the name specified, which must have an attribute with the value specified. The type of value assumed to be 'CDATA'.
Parameters:
tagName - The name of the tag.
attrName - The name of attribute which must be contained in the tag.
attrValue - Attribute value.

XMLTools.Tag

public XMLTools.Tag(String tagName,
                    String[] attrNames)
Creates a tag with the name specified, which must have attributes specified. The value of thesee attributes doesn't make sense.
Parameters:
tagName - The name of the tag.
attrNames - Array with names of attributes which must be contained in the tag.

XMLTools.Tag

public XMLTools.Tag(String tagName,
                    String[][] attrValues)
Creates a tag with the name specified, which must have an attributes with their values specified. The type of all values assumed to be 'CDATA'.
Parameters:
tagName - The name of the tag.
attrValues - An array with attribute names and their values. attrValues[N][0] element contains the name of Nth attribute, and attrValues[N][1] element contains value of Nth attribute, if value is null then the attribute value can be any.
Method Detail

toString

public String toString()
Gets tag String description.
Overrides:
toString in class Object

checkAttr

protected boolean checkAttr(int attrListIdx,
                            com.sun.star.xml.sax.XAttributeList list)

isMatchTo

public boolean isMatchTo(String tagName,
                         com.sun.star.xml.sax.XAttributeList list)
Checks if this tag matches tag passed in parameters. I.e. if tag specifies only it's name it mathes if names are equal (attributes don't make sense). If there are some attributes names specified in this tag method checks if all names present in attribute list list (attributes' values don't make sense). If attributes specified with values method checks if these attributes exist and have appropriate values.

OOoRunner test harness

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.