|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.joost.stx.SAXEvent
public final class SAXEvent
SAXEvent stores all information attached to an incoming SAX event, it is the representation of a node in STX.
Nested Class Summary | |
---|---|
private class |
SAXEvent.Counter
This class replaces java.lang.Long for counting because I need to change the wrapped value and want to avoid the creation of a new object in each increment. |
private static class |
SAXEvent.DoubleString
This class acts as a wrapper for a pair of String objects. |
Field Summary | |
---|---|
static int |
ATTRIBUTE
|
MutableAttributes |
attrs
|
static int |
CDATA
|
static int |
COMMENT
|
static int |
ELEMENT
|
static int |
ELEMENT_END
|
private static SAXEvent.DoubleString |
GENERIC_ELEMENT
|
private static SAXEvent.DoubleString |
GENERIC_PI
|
boolean |
hasChildNodes
|
String |
lName
|
static int |
MAPPING
|
static int |
MAPPING_END
|
Hashtable |
namespaces
|
static int |
PI
|
private HashMap |
posHash
contains the position counters |
String |
qName
|
static int |
ROOT
|
static int |
TEXT
|
int |
type
|
String |
uri
|
String |
value
|
Constructor Summary | |
---|---|
private |
SAXEvent()
|
Method Summary | |
---|---|
private void |
_countPosition(Object[] keys)
Performs the real counting. |
Object |
clone()
|
void |
countCDATA()
Increments the associated counters for a text CDATA node. |
void |
countComment()
Increments the associated counters for a comment node. |
void |
countElement(String uri,
String lName)
Increments the associated counters for an element. |
void |
countPI(String target)
Increment the associated counters for a processing instruction node. |
void |
countText()
Increments the associated counters for a text node. |
void |
enableChildNodes(boolean hasChildNodes)
Enables the counting of child nodes. |
long |
getPositionOf(String uri,
String lName)
|
long |
getPositionOfCDATA()
|
long |
getPositionOfComment()
|
long |
getPositionOfNode()
|
long |
getPositionOfPI(String target)
|
long |
getPositionOfText()
|
static SAXEvent |
newAttribute(Attributes attrs,
int index)
Create a new attribute node |
static SAXEvent |
newAttribute(String uri,
String lname,
String qName,
String value)
Create a new attribute node |
static SAXEvent |
newCDATA(String value)
Create a new CDATA node |
static SAXEvent |
newComment(String value)
Create a new comment node |
static SAXEvent |
newElement(String uri,
String lName,
String qName,
Attributes attrs,
boolean mutable,
Hashtable inScopeNamespaces)
Create a new element node |
static SAXEvent |
newMapping(String prefix,
String uri)
Create a new representation for a namespace mapping |
static SAXEvent |
newPI(String target,
String data)
Create a new processing instruction node |
static SAXEvent |
newRoot()
Create a root node |
static SAXEvent |
newText(String value)
Create a new text node |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ROOT
public static final int ELEMENT
public static final int TEXT
public static final int CDATA
public static final int PI
public static final int COMMENT
public static final int ATTRIBUTE
public static final int ELEMENT_END
public static final int MAPPING
public static final int MAPPING_END
public int type
public String uri
public String lName
public String qName
public MutableAttributes attrs
public Hashtable namespaces
public String value
public boolean hasChildNodes
private HashMap posHash
private static final SAXEvent.DoubleString GENERIC_ELEMENT
private static final SAXEvent.DoubleString GENERIC_PI
Constructor Detail |
---|
private SAXEvent()
Method Detail |
---|
public static SAXEvent newElement(String uri, String lName, String qName, Attributes attrs, boolean mutable, Hashtable inScopeNamespaces)
public static SAXEvent newText(String value)
public static SAXEvent newCDATA(String value)
public static SAXEvent newRoot()
public static SAXEvent newComment(String value)
public static SAXEvent newPI(String target, String data)
public static SAXEvent newAttribute(String uri, String lname, String qName, String value)
public static SAXEvent newAttribute(Attributes attrs, int index)
public static SAXEvent newMapping(String prefix, String uri)
public void enableChildNodes(boolean hasChildNodes)
hasChildNodes
- true
, if there are really child nodes;
false
, if only the counting has to be
supported (e.g. in stx:process-buffer
)public void countElement(String uri, String lName)
public void countText()
public void countCDATA()
public void countComment()
public void countPI(String target)
private void _countPosition(Object[] keys)
public long getPositionOf(String uri, String lName)
public long getPositionOfNode()
public long getPositionOfText()
public long getPositionOfCDATA()
public long getPositionOfComment()
public long getPositionOfPI(String target)
public Object clone()
clone
in class Object
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |