com.android.ide.common.xml
Enum XmlFormatStyle

java.lang.Object
  extended by java.lang.Enum<XmlFormatStyle>
      extended by com.android.ide.common.xml.XmlFormatStyle
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<XmlFormatStyle>

public enum XmlFormatStyle
extends java.lang.Enum<XmlFormatStyle>

Style to use when printing the XML. Different types of Android XML files use slightly different preferred formats. For example, in layout files there is typically always a newline between successive elements, whereas in a manifest file there is typically only newlines between different types of elements. As another example, in resource files, the format is typically much more compact: the text content of <item> tags is included on the same line whereas for other layout styles the children are typically placed on a line of their own.


Enum Constant Summary
FILE
          Similar to layout formatting style, but no blank lines inside opening elements
LAYOUT
          Layout formatting style: blank lines between elements, attributes on separate lines
MANIFEST
          Similar to layout style, but no newlines between related elements such as successive <uses-permission> declarations, and no newlines inside the second level elements (so an <activity> declaration appears as a single block with no whitespace within it)
RESOURCE
          Resource style: one line per complete element including text child content
 
Method Summary
static XmlFormatStyle get(org.w3c.dom.Node node)
           
static XmlFormatStyle valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static XmlFormatStyle[] 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

LAYOUT

public static final XmlFormatStyle LAYOUT
Layout formatting style: blank lines between elements, attributes on separate lines


FILE

public static final XmlFormatStyle FILE
Similar to layout formatting style, but no blank lines inside opening elements


RESOURCE

public static final XmlFormatStyle RESOURCE
Resource style: one line per complete element including text child content


MANIFEST

public static final XmlFormatStyle MANIFEST
Similar to layout style, but no newlines between related elements such as successive <uses-permission> declarations, and no newlines inside the second level elements (so an <activity> declaration appears as a single block with no whitespace within it)

Method Detail

values

public static XmlFormatStyle[] 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 (XmlFormatStyle c : XmlFormatStyle.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static XmlFormatStyle valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

get

@NonNull
public static XmlFormatStyle get(@Nullable
                                         org.w3c.dom.Node node)