|
JDOM 2.0.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<Content.CType>
org.jdom2.Content.CType
public static enum Content.CType
An enumeration useful for identifying content types without
having to do instanceof type conditionals.
instanceof is not a particularly safe way to test content
in JDOM because CDATA extends Text ( a CDATA instance is an
instanceof Text).
This CType enumeration provides a direct and sure mechanism for identifying JDOM content.
These can be used in switch-type statements too (which is much neater than chained if (instanceof) else if (instanceof) else .... expressions):
switch(content.getCType()) {
case Text :
.....
break;
case CDATA :
.....
break;
....
}
| Enum Constant Summary | |
|---|---|
CDATA
Represents CDATA content |
|
Comment
Represents Comment content |
|
DocType
Represents DocType content |
|
Element
Represents Element content |
|
EntityRef
Represents EntityRef content |
|
ProcessingInstruction
Represents ProcessingInstruction content |
|
Text
Represents Text content |
|
| Method Summary | |
|---|---|
static Content.CType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static Content.CType[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final Content.CType Comment
Comment content
public static final Content.CType Element
Element content
public static final Content.CType ProcessingInstruction
ProcessingInstruction content
public static final Content.CType EntityRef
EntityRef content
public static final Content.CType Text
Text content
public static final Content.CType CDATA
CDATA content
public static final Content.CType DocType
DocType content
| Method Detail |
|---|
public static Content.CType[] values()
for (Content.CType c : Content.CType.values()) System.out.println(c);
public static Content.CType valueOf(java.lang.String name)
name - the name of the enum constant to be returned.
java.lang.IllegalArgumentException - if this enum type has no constant
with the specified name
java.lang.NullPointerException - if the argument is null
|
JDOM 2.0.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||