wt.ixb.impl.doc
Class IxbDomElement

java.lang.Object
  extended bywt.ixb.impl.doc.IxbDomElement
All Implemented Interfaces:
IxbElement
Direct Known Subclasses:
IxbDomDocument

public class IxbDomElement
extends Object
implements IxbElement

That is a wraper for org.w3c.dom.Element; Now it is rather pointless. I use it to be able in future to have another, not DOM based implementation. This implementation can be based on the DB stage tables or something similar


Nested Class Summary
protected  class IxbDomElement.IxbDefaultHandler
           
 
Field Summary
(package private)  Element domElem
           
private static String END_ENCODE_SYMBOL
           
private static char[] invalidCharsTabl
           
(package private)  IxbDomDocument ixbDoc
           
private static String[] markupCharsTabl
           
private  char PATH_DELIMITER
           
private  SAXParser saxParser
           
private static String[] shifts
           
private static String START_ENCODE_SYMBOL
           
private  String stSystemId
           
static String UTF8_INVALID_CHAR
           
protected  boolean validate
           
private  Boolean validateOnExport
           
 
Constructor Summary
IxbDomElement(IxbDomDocument _doc, Element _el)
           
 
Method Summary
 void addAdvancedDomAttributesOfForeignElement(IxbElement el)
          Copies to the element such nodes as CData Processing instructions and so on.Is used by Tuner only

Supported API: false
 void addAttribute(String key, String value)
          

Supported API: true
 IxbElement addCDataSectionValue(String key, String value)
          

Supported API: true
 void addCommentByCopy(Object el)
          

Supported API: false
 void addElement(IxbElement el)
          

Supported API: true
 IxbElement addElement(String key)
          

Supported API: true
 void addForeignElementByAdopt(IxbElement el)
          Makes foreign elem native by adopt - not standard DOM feature !!! DO NOT USE THIS METHOD - IT DOES NOT WORK IN CURRENT xerces IMPLEMENTATION !!!
 void addForeignElementByCopy(IxbElement el)
          Makes foreign elem native by copy - i.e.
 IxbElement addValue(String key, boolean value)
          

Supported API: true
 IxbElement addValue(String key, double value)
          

Supported API: true
 IxbElement addValue(String key, int value)
          

Supported API: true
 IxbElement addValue(String key, long value)
          

Supported API: true
 IxbElement addValue(String key, String value)
          

Supported API: true
private  String encodeMarkupCharsAndInvalidChars(String s)
           
 String getAttribute(String key)
          

Supported API: true
 Enumeration getAttributes()
          

Supported API: true
 Hashtable getAttributeValuePairs()
          Returns Hashtable of pairs: (attrName, attrValue)

Supported API: true
 Boolean getBooleanValue(String key)
          

Supported API: true
private  Element getChildByTagName(String tag)
           
private static NodeList getChildNodes(Node node, short type)
          Return a NodeList that contains the children of the specified node that are of the specified type.
private static NodeList getChildNodes(Node node, short[] types)
          Return a NodeList that contains the children of the specified node that are of the specified types.
private  Vector getChildrenByTagName(String tag)
           
 Element getDomElement()
           
 Double getDoubleValue(String key)
          

Supported API: true
 IxbElement getElement(String key)
          

Supported API: true
 Enumeration getElements()
          

Supported API: true
 Enumeration getElements(String key)
          

Supported API: true
 Enumeration getElementsAndComments()
          

Supported API: false
 Integer getIntValue(String key)
          

Supported API: true
private  String getKeyOfPathKey(String pathKey)
           
 Iterator getKeys()
          

Supported API: true
 Long getLongValue(String key)
          

Supported API: true
 IxbElement getParent()
          

Supported API: true
private  String getPathOfPathKey(String pathKey)
           
private  String getShift(int level)
           
 String getSystemId()
           
 String getTag()
          

Supported API: true
private  String getTextNodeLikeValue(Node node)
           
private static String getTypeName(short type)
           
 String getValue()
          

Supported API: true
 String getValue(String key)
          

Supported API: true
 Enumeration getValues(String key)
          

Supported API: true
private static void initMarkupCharsTabl()
           
private  void initSaxParser()
           
private  String internalTrimIgnoreSpace(String str)
          this method works similar to String.trim(), but leaves "space hex(20)" in place
 boolean isCDATASectionElement()
          

Supported API: true
 boolean isCommentElement()
          

Supported API: true
private static boolean isOfType(Node node, short[] types)
          Return true if the type of the specified node is included in the specified list of node types.
 boolean isTextElement()
          

Supported API: true
private static void PP(String s)
           
private  void printDOMTree(Node node, PrintWriter System_out, int level)
           
private  String realEncodeInvalidChars(String s)
           
private  String realEncodeMarkupChars(String s)
           
 void removeChildElement(IxbElement el)
          

Supported API: true
 IxbElement setValue(String key, String newValue)
          

Supported API: true
 File store(File xmlFile, String dtdName)
          

Supported API: true
 void store(OutputStream stream, String dtdName)
          

Supported API: true
 String store(String dtdName)
          

Supported API: true
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

START_ENCODE_SYMBOL

private static final String START_ENCODE_SYMBOL
See Also:
Constant Field Values

END_ENCODE_SYMBOL

private static final String END_ENCODE_SYMBOL
See Also:
Constant Field Values

UTF8_INVALID_CHAR

public static final String UTF8_INVALID_CHAR
See Also:
Constant Field Values

ixbDoc

IxbDomDocument ixbDoc

domElem

Element domElem

PATH_DELIMITER

private char PATH_DELIMITER

shifts

private static String[] shifts

markupCharsTabl

private static String[] markupCharsTabl

invalidCharsTabl

private static char[] invalidCharsTabl

validateOnExport

private Boolean validateOnExport

saxParser

private SAXParser saxParser

stSystemId

private String stSystemId

validate

protected boolean validate
Constructor Detail

IxbDomElement

public IxbDomElement(IxbDomDocument _doc,
                     Element _el)
Method Detail

getSystemId

public String getSystemId()

getDomElement

public Element getDomElement()

isTextElement

public boolean isTextElement()
                      throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
isTextElement in interface IxbElement
Returns:
boolean
Throws:
WTException

isCommentElement

public boolean isCommentElement()
                         throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
isCommentElement in interface IxbElement
Returns:
boolean
Throws:
WTException

isCDATASectionElement

public boolean isCDATASectionElement()
                              throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
isCDATASectionElement in interface IxbElement
Returns:
boolean
Throws:
WTException

getParent

public IxbElement getParent()
                     throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getParent in interface IxbElement
Returns:
IxbElement
Throws:
WTException

getValue

public String getValue()
                throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getValue in interface IxbElement
Returns:
String
Throws:
WTException

getAttributes

public Enumeration getAttributes()
                          throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getAttributes in interface IxbElement
Returns:
Enumeration
Throws:
WTException

getAttributeValuePairs

public Hashtable getAttributeValuePairs()
                                 throws WTException
Description copied from interface: IxbElement
Returns Hashtable of pairs: (attrName, attrValue)

Supported API: true

Specified by:
getAttributeValuePairs in interface IxbElement
Returns:
Hashtable
Throws:
WTException

getElements

public Enumeration getElements()
                        throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getElements in interface IxbElement
Returns:
Enumeration
Throws:
WTException

addCommentByCopy

public void addCommentByCopy(Object el)
                      throws WTException
Description copied from interface: IxbElement


Supported API: false

Specified by:
addCommentByCopy in interface IxbElement
Parameters:
el -
Throws:
WTException

getElementsAndComments

public Enumeration getElementsAndComments()
                                   throws WTException
Description copied from interface: IxbElement


Supported API: false

Specified by:
getElementsAndComments in interface IxbElement
Returns:
Enumeration
Throws:
WTException

addAttribute

public void addAttribute(String key,
                         String value)
                  throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
addAttribute in interface IxbElement
Parameters:
key -
value -
Throws:
WTException

addCDataSectionValue

public IxbElement addCDataSectionValue(String key,
                                       String value)
                                throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
addCDataSectionValue in interface IxbElement
Parameters:
key -
value -
Returns:
IxbElement
Throws:
WTException

addValue

public IxbElement addValue(String key,
                           String value)
                    throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
addValue in interface IxbElement
Parameters:
key -
value -
Returns:
IxbElement
Throws:
WTException

setValue

public IxbElement setValue(String key,
                           String newValue)
                    throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
setValue in interface IxbElement
Parameters:
key -
newValue -
Returns:
IxbElement
Throws:
WTException

addElement

public IxbElement addElement(String key)
                      throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
addElement in interface IxbElement
Parameters:
key -
Returns:
IxbElement
Throws:
WTException

addElement

public void addElement(IxbElement el)
                throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
addElement in interface IxbElement
Parameters:
el -
Throws:
WTException

removeChildElement

public void removeChildElement(IxbElement el)
                        throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
removeChildElement in interface IxbElement
Parameters:
el -
Throws:
WTException

addAdvancedDomAttributesOfForeignElement

public void addAdvancedDomAttributesOfForeignElement(IxbElement el)
                                              throws WTException
Description copied from interface: IxbElement
Copies to the element such nodes as CData Processing instructions and so on.Is used by Tuner only

Supported API: false

Specified by:
addAdvancedDomAttributesOfForeignElement in interface IxbElement
Parameters:
el -
Throws:
WTException

addForeignElementByCopy

public void addForeignElementByCopy(IxbElement el)
                             throws WTException
Description copied from interface: IxbElement
Makes foreign elem native by copy - i.e. by importNode()

Supported API: true

Specified by:
addForeignElementByCopy in interface IxbElement
Parameters:
el -
Throws:
WTException

addForeignElementByAdopt

public void addForeignElementByAdopt(IxbElement el)
                              throws WTException
Makes foreign elem native by adopt - not standard DOM feature !!! DO NOT USE THIS METHOD - IT DOES NOT WORK IN CURRENT xerces IMPLEMENTATION !!!

Specified by:
addForeignElementByAdopt in interface IxbElement
Parameters:
el -
Throws:
WTException

getTag

public String getTag()
              throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getTag in interface IxbElement
Returns:
String
Throws:
WTException

getAttribute

public String getAttribute(String key)
                    throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getAttribute in interface IxbElement
Parameters:
key -
Returns:
String
Throws:
WTException

getValue

public String getValue(String key)
                throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getValue in interface IxbElement
Parameters:
key -
Returns:
String
Throws:
WTException

getValues

public Enumeration getValues(String key)
                      throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getValues in interface IxbElement
Parameters:
key -
Returns:
Enumeration
Throws:
WTException

getTextNodeLikeValue

private String getTextNodeLikeValue(Node node)
                             throws WTException
Throws:
WTException

getElement

public IxbElement getElement(String key)
                      throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getElement in interface IxbElement
Parameters:
key -
Returns:
IxbElement
Throws:
WTException

getElements

public Enumeration getElements(String key)
                        throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getElements in interface IxbElement
Parameters:
key -
Returns:
Enumeration
Throws:
WTException

getKeys

public Iterator getKeys()
                 throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getKeys in interface IxbElement
Returns:
Iterator
Throws:
WTException

getPathOfPathKey

private String getPathOfPathKey(String pathKey)

getKeyOfPathKey

private String getKeyOfPathKey(String pathKey)

getChildrenByTagName

private Vector getChildrenByTagName(String tag)

getChildByTagName

private Element getChildByTagName(String tag)

addValue

public IxbElement addValue(String key,
                           int value)
                    throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
addValue in interface IxbElement
Parameters:
key -
value -
Returns:
IxbElement
Throws:
WTException

addValue

public IxbElement addValue(String key,
                           long value)
                    throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
addValue in interface IxbElement
Parameters:
key -
value -
Returns:
IxbElement
Throws:
WTException

addValue

public IxbElement addValue(String key,
                           boolean value)
                    throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
addValue in interface IxbElement
Parameters:
key -
value -
Returns:
IxbElement
Throws:
WTException

addValue

public IxbElement addValue(String key,
                           double value)
                    throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
addValue in interface IxbElement
Parameters:
key -
value -
Returns:
IxbElement
Throws:
WTException

getIntValue

public Integer getIntValue(String key)
                    throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getIntValue in interface IxbElement
Parameters:
key -
Returns:
Integer
Throws:
WTException

getLongValue

public Long getLongValue(String key)
                  throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getLongValue in interface IxbElement
Parameters:
key -
Returns:
Long
Throws:
WTException

getDoubleValue

public Double getDoubleValue(String key)
                      throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getDoubleValue in interface IxbElement
Parameters:
key -
Returns:
Double
Throws:
WTException

getBooleanValue

public Boolean getBooleanValue(String key)
                        throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
getBooleanValue in interface IxbElement
Parameters:
key -
Returns:
Boolean
Throws:
WTException

store

public String store(String dtdName)
             throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
store in interface IxbElement
Parameters:
dtdName -
Returns:
String
Throws:
WTException

store

public void store(OutputStream stream,
                  String dtdName)
           throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
store in interface IxbElement
Parameters:
stream -
dtdName -
Throws:
WTException

store

public File store(File xmlFile,
                  String dtdName)
           throws WTException
Description copied from interface: IxbElement


Supported API: true

Specified by:
store in interface IxbElement
Parameters:
xmlFile -
dtdName -
Returns:
File
Throws:
WTException

getShift

private String getShift(int level)

printDOMTree

private void printDOMTree(Node node,
                          PrintWriter System_out,
                          int level)

encodeMarkupCharsAndInvalidChars

private String encodeMarkupCharsAndInvalidChars(String s)

realEncodeInvalidChars

private String realEncodeInvalidChars(String s)

realEncodeMarkupChars

private String realEncodeMarkupChars(String s)

initMarkupCharsTabl

private static void initMarkupCharsTabl()

getChildNodes

private static NodeList getChildNodes(Node node,
                                      short type)
Return a NodeList that contains the children of the specified node that are of the specified type.

Parameters:
node - the node whose children should be returned
type - one of the node type constants defined by the Node class

getChildNodes

private static NodeList getChildNodes(Node node,
                                      short[] types)
Return a NodeList that contains the children of the specified node that are of the specified types.

Parameters:
node - the node whose children should be returned
types - a list of node type constants defined by the Node class

isOfType

private static boolean isOfType(Node node,
                                short[] types)
Return true if the type of the specified node is included in the specified list of node types.

Parameters:
node - the node whose type should be compared against the specified list of types
types - a list of node type constants defined by the Node class

getTypeName

private static String getTypeName(short type)

internalTrimIgnoreSpace

private String internalTrimIgnoreSpace(String str)
this method works similar to String.trim(), but leaves "space hex(20)" in place


initSaxParser

private void initSaxParser()
                    throws WTException
Throws:
WTException

PP

private static void PP(String s)