|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavanet.staxutils.helpers.EventMatcher
public final class EventMatcher
Provides utility methods useful for comparing two XMLEvent instances.
These methods compare only location/type-independent information, and thus don't
perform strict equality testing, which would include the event's location,
schema-type and dtd-type.
| Method Summary | |
|---|---|
static boolean |
eventsMatch(Attribute a,
Attribute b)
Compares two Attributes, returning true if their names
and values are the same. |
static boolean |
eventsMatch(Characters a,
Characters b)
Compares two Characterss. |
static boolean |
eventsMatch(Comment a,
Comment b)
Compares two Comments. |
static boolean |
eventsMatch(DTD a,
DTD b)
Compares two DTDs. |
static boolean |
eventsMatch(EndDocument a,
EndDocument b)
Compares two EndDocuments. |
static boolean |
eventsMatch(EndElement a,
EndElement b)
Compares two EndElements. |
static boolean |
eventsMatch(EntityDeclaration a,
EntityDeclaration b)
Compares two EntityDeclarations. |
static boolean |
eventsMatch(EntityReference a,
EntityReference b)
Compares two EntityReferences. |
static boolean |
eventsMatch(Namespace a,
Namespace b)
Compares two Namespaces. |
static boolean |
eventsMatch(NotationDeclaration a,
NotationDeclaration b)
Compares two NotationDeclarations. |
static boolean |
eventsMatch(ProcessingInstruction a,
ProcessingInstruction b)
Compares two ProcessingInstructions. |
static boolean |
eventsMatch(StartDocument a,
StartDocument b)
Compares two StartDocuments. |
static boolean |
eventsMatch(StartElement a,
StartElement b)
Compares two StartElements. |
static boolean |
eventsMatch(XMLEvent a,
XMLEvent b)
Compares two XMLEvent instances. |
static boolean |
matchAttributes(Iterator a,
Iterator b)
Iterates over two sets of Attributes and determines if both contain
matching attributes. |
static boolean |
matchNamespaces(Iterator a,
Iterator b)
Iterates over two sets of Namespaces and determines if both contain
matching namespaces. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean eventsMatch(XMLEvent a,
XMLEvent b)
XMLEvent instances. This method delegates actual
matching to the appropriate overloaded method.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean eventsMatch(Attribute a,
Attribute b)
Attributes, returning true if their names
and values are the same.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean eventsMatch(Characters a,
Characters b)
Characterss. This method will return true
only if they have the same event type (XMLStreamConstants.CHARACTERS,
XMLStreamConstants.CDATA, or XMLStreamConstants.SPACE), and their text content
matches.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean eventsMatch(Comment a,
Comment b)
Comments. This method will return true
only if their text content matches.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean eventsMatch(DTD a,
DTD b)
DTDs. This method will return true
only if their declarations are identical.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean eventsMatch(EndDocument a,
EndDocument b)
EndDocuments. Because EndDocument events have no
real state, two instances always match.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean eventsMatch(EndElement a,
EndElement b)
EndElements. This method will return true
only if their names match.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean eventsMatch(EntityDeclaration a,
EntityDeclaration b)
EntityDeclarations. This method will return
true only if the two events' names, replacement text, public IDs,
system IDs, and notations are the same.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean eventsMatch(EntityReference a,
EntityReference b)
EntityReferences. This method will return
true only if the two references have the same name, and their
declarations also match.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean eventsMatch(Namespace a,
Namespace b)
Namespaces. This method will return true
only if the two namespaces have identical prefixes and namespace URIs.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean eventsMatch(NotationDeclaration a,
NotationDeclaration b)
NotationDeclarations. This method will return
true only if the two namespaces have identical names, public IDs,
and system IDs.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean eventsMatch(ProcessingInstruction a,
ProcessingInstruction b)
ProcessingInstructions. This method will return
true only if the two events have identical targets and data.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean eventsMatch(StartDocument a,
StartDocument b)
StartDocuments. This method will return
true only if the two events have identical encodings, versions,
and have the same standalone setting.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean eventsMatch(StartElement a,
StartElement b)
StartElements. This method will return
true only if the two events have identical names, attributes, and
namespaces.
a - The first event.b - The second event.
true if the events match, false otherwise.
public static boolean matchAttributes(Iterator a,
Iterator b)
Attributes and determines if both contain
matching attributes.
a - The first set of Attributes.b - The second set of Attributes.
true if the two iterators iterate over matching
attributes, false otherwise.
public static boolean matchNamespaces(Iterator a,
Iterator b)
Namespaces and determines if both contain
matching namespaces.
a - The first set of Namespaces.b - The second set of Namespaces.
true if the two iterators iterate over matching
namespaces, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||