Package com.helger.commons.mime
Enum EMimeQuoting
- java.lang.Object
-
- java.lang.Enum<EMimeQuoting>
-
- com.helger.commons.mime.EMimeQuoting
-
- All Implemented Interfaces:
Serializable,Comparable<EMimeQuoting>
public enum EMimeQuoting extends Enum<EMimeQuoting>
Defines the possible MIME type parameter value quotings- Author:
- Philip Helger
-
-
Enum Constant Summary
Enum Constants Enum Constant Description QUOTED_PRINTABLECreate a quoted printable String.QUOTED_STRINGCreate a quoted string according to RFC 822 (surrounding everything in double-quotes and masking using backslash).
Example:foo barresults in"foo bar"URL_ESCAPECreate a URL escaped String.
-
Field Summary
Fields Modifier and Type Field Description static charQUOTED_STRING_MASK_CHARstatic charQUOTED_STRING_SEPARATOR_CHAR
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract StringgetQuotedString(String sUnquotedString)abstract StringgetUnquotedString(String sQuotedString)booleanisQuotedString()static EMimeQuotingvalueOf(String name)Returns the enum constant of this type with the specified name.static EMimeQuoting[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
QUOTED_STRING
public static final EMimeQuoting QUOTED_STRING
Create a quoted string according to RFC 822 (surrounding everything in double-quotes and masking using backslash).
Example:foo barresults in"foo bar"
-
QUOTED_PRINTABLE
public static final EMimeQuoting QUOTED_PRINTABLE
Create a quoted printable String. Replace all non-printable characters with =XY where XY is the hex encoding of the char.
Example:foo barresults infoo=20bar
-
URL_ESCAPE
public static final EMimeQuoting URL_ESCAPE
Create a URL escaped String. Replace all non-printable characters with %XY where XY is the hex encoding of the char. Special note: space (ASCII 20) should be escaped as "%20" and not as "+".
Example:foo barresults infoo%20bar
-
-
Field Detail
-
QUOTED_STRING_SEPARATOR_CHAR
public static final char QUOTED_STRING_SEPARATOR_CHAR
- See Also:
- Constant Field Values
-
QUOTED_STRING_MASK_CHAR
public static final char QUOTED_STRING_MASK_CHAR
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static EMimeQuoting[] 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 (EMimeQuoting c : EMimeQuoting.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EMimeQuoting 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
-
getQuotedString
@Nonnull @Nonempty public abstract String getQuotedString(@Nonnull @Nonempty String sUnquotedString)
-
getUnquotedString
@Nonnull @Nonempty public abstract String getUnquotedString(@Nonnull @Nonempty String sQuotedString)
-
isQuotedString
public boolean isQuotedString()
- Returns:
trueif this ==QUOTED_STRING,falseotherwise.
-
-