Package org.codehaus.staxmate.in
Enum SMEvent
- All Implemented Interfaces:
Serializable
,Comparable<SMEvent>
,java.lang.constant.Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThis is a placeholder event which should never be encountered during normal operation. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
Set of events for whichhasLocalName()
returns true.private static final int
Set of events for whichhasQName()
returns true; generally anything for which real QName could be constructed.private static final int
Set of events for whichhasText()
returns trueprivate static final int
Set of events for whichisTextualEvent()
returns trueprivate final int
This is the underlying Stax 1.0 event constant matching this StaxMate event enum. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static SMEvent[]
Method that will construct the mapping from event id int codes (used byXMLStreamReader
to actualSMEvent
enum values.int
boolean
This method returns true if it would be ok to callSMInputCursor.getLocalName()
of the iterator object, when it is positioned over this event.boolean
hasQName()
This method returns true if it would be ok to callSMInputCursor.getQName()
of the iterator object, when it is positioned over this event.boolean
hasText()
This method returns true if it would be ok to callSMInputCursor.getText()
of the iterator object, when it is positioned over this event.boolean
boolean
Textual events are events that consist of regular document text content: ignorable white space, CDATA segments, and other text.static SMEvent
Returns the enum constant of this type with the specified name.static SMEvent[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
START_DOCUMENT
-
END_DOCUMENT
-
START_ELEMENT
-
END_ELEMENT
-
TEXT
-
CDATA
-
IGNORABLE_WS
-
COMMENT
-
PROCESSING_INSTR
-
DOCTYPE_DECL
-
ENTITY_DECL
-
ENTITY_REF
-
NOTATION_DECL
-
ATTRIBUTE
-
NAMESPACE_DECL
-
UNKNOWN
This is a placeholder event which should never be encountered during normal operation. It is only used if an underlying event is of unrecognized type, ie. application-specific extension StaxMate is not aware of.
-
-
Field Details
-
mEventType
private final int mEventTypeThis is the underlying Stax 1.0 event constant matching this StaxMate event enum. -
MASK_TEXTUAL_EVENT
private static final int MASK_TEXTUAL_EVENTSet of events for whichisTextualEvent()
returns true- See Also:
-
MASK_HAS_TEXT
private static final int MASK_HAS_TEXTSet of events for whichhasText()
returns true- See Also:
-
MASK_HAS_QNAME
private static final int MASK_HAS_QNAMESet of events for whichhasQName()
returns true; generally anything for which real QName could be constructed.- See Also:
-
MASK_HAS_LOCAL_NAME
private static final int MASK_HAS_LOCAL_NAMESet of events for whichhasLocalName()
returns true. It is a superset of those for whichhasQName()
returns true, since things like processing instructions, declarations, references, and even DOCTYPE declrations have identifiers that can be thought of as local names.- See Also:
-
-
Constructor Details
-
SMEvent
private SMEvent(int evtType)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getEventCode
public int getEventCode()- Returns:
- Underlying Stax 1.0 event code (int) that matches this event enumeration object.
-
isElementEvent
public boolean isElementEvent()- Returns:
- True, if the event is a start or end element event; false otherwise.
-
isTextualEvent
public boolean isTextualEvent()Textual events are events that consist of regular document text content: ignorable white space, CDATA segments, and other text. For these types,XMLStreamReader.getText()
methods can be called, and they can also be output using regular text output methods.Note that set of events for which this returns true is less than that of
hasText()
; since this only includes "true" textual events, not just events that have some associated text. -
hasText
public boolean hasText()This method returns true if it would be ok to callSMInputCursor.getText()
of the iterator object, when it is positioned over this event.Note that set of events for which this returns true is bigger than for which
XMLStreamReader.hasText()
returns true; this because StaxMate has looser definition of contained text. For example, true will be returned for Processing Instructions, since the 'data' part of the processing instruction is considered to be text by StaxMate. -
hasLocalName
public boolean hasLocalName()This method returns true if it would be ok to callSMInputCursor.getLocalName()
of the iterator object, when it is positioned over this event. -
hasQName
public boolean hasQName()This method returns true if it would be ok to callSMInputCursor.getQName()
of the iterator object, when it is positioned over this event. -
constructIdToEventMapping
Method that will construct the mapping from event id int codes (used byXMLStreamReader
to actualSMEvent
enum values.
-