Package com.helger.xml.serialize.write
Enum EXMLSerializeIndent
- java.lang.Object
-
- java.lang.Enum<EXMLSerializeIndent>
-
- com.helger.xml.serialize.write.EXMLSerializeIndent
-
- All Implemented Interfaces:
com.helger.commons.id.IHasID<String>,Serializable,Comparable<EXMLSerializeIndent>
public enum EXMLSerializeIndent extends Enum<EXMLSerializeIndent> implements com.helger.commons.id.IHasID<String>
Determines the indentation and alignment mode of XML serialization. Alignment means: newlines after certain elements. Indent means: adding blanks at the beginning of the line to reflect the tree structure of an XML document more visibly.- Author:
- Philip Helger
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALIGN_ONLYNo indent but alignINDENT_AND_ALIGNBoth indent and align.INDENT_ONLYIndent but no align.NONENeither indent nor align
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EXMLSerializeIndentgetFromIDOrNull(String sID)StringgetID()EXMLSerializeIndentgetWithAlign()EXMLSerializeIndentgetWithIndent()EXMLSerializeIndentgetWithoutAlign()EXMLSerializeIndentgetWithoutIndent()booleanisAlign()booleanisIndent()static EXMLSerializeIndentvalueOf(String name)Returns the enum constant of this type with the specified name.static EXMLSerializeIndent[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final EXMLSerializeIndent NONE
Neither indent nor align
-
ALIGN_ONLY
public static final EXMLSerializeIndent ALIGN_ONLY
No indent but align
-
INDENT_ONLY
public static final EXMLSerializeIndent INDENT_ONLY
Indent but no align.
-
INDENT_AND_ALIGN
public static final EXMLSerializeIndent INDENT_AND_ALIGN
Both indent and align.
-
-
Method Detail
-
values
public static EXMLSerializeIndent[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EXMLSerializeIndent c : EXMLSerializeIndent.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EXMLSerializeIndent valueOf(String name)
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
-
getID
@Nonnull @Nonempty public String getID()
- Specified by:
getIDin interfacecom.helger.commons.id.IHasID<String>
-
isIndent
public boolean isIndent()
- Returns:
trueif the XML output should be formatted nicely
-
isAlign
public boolean isAlign()
- Returns:
trueif newlines should be emitted
-
getWithoutIndent
@Nonnull public EXMLSerializeIndent getWithoutIndent()
-
getWithIndent
@Nonnull public EXMLSerializeIndent getWithIndent()
-
getWithoutAlign
@Nonnull public EXMLSerializeIndent getWithoutAlign()
-
getWithAlign
@Nonnull public EXMLSerializeIndent getWithAlign()
-
getFromIDOrNull
@Nullable public static EXMLSerializeIndent getFromIDOrNull(@Nullable String sID)
-
-