Package edu.harvard.hul.ois.jhove
Enum Utils
- java.lang.Object
-
- java.lang.Enum<Utils>
-
- edu.harvard.hul.ois.jhove.Utils
-
- All Implemented Interfaces:
Serializable,Comparable<Utils>
public enum Utils extends Enum<Utils>
- Author:
- cfw
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringencodeContent(String content)Encodes a content String in XML-clean form, converting characters to entities as necessary and removing control characters disallowed by XML.static StringencodeValue(String value)Encodes an attribute value String in XML-clean form, converting quote characters to entities and removing control characters disallowed by XML.static booleanisPropertyEmpty(Property property, PropertyArity arity)Checks if a property would produce an empty XML element, and returns true if it would.static UtilsvalueOf(String name)Returns the enum constant of this type with the specified name.static Utils[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final Utils INSTANCE
-
-
Method Detail
-
values
public static Utils[] 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 (Utils c : Utils.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Utils 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
-
encodeContent
public static String encodeContent(String content)
Encodes a content String in XML-clean form, converting characters to entities as necessary and removing control characters disallowed by XML. The null string will be converted to an empty string.
-
encodeValue
public static String encodeValue(String value)
Encodes an attribute value String in XML-clean form, converting quote characters to entities and removing control characters disallowed by XML.
-
isPropertyEmpty
public static boolean isPropertyEmpty(Property property, PropertyArity arity)
Checks if a property would produce an empty XML element, and returns true if it would.
-
-