|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.xolite.ElementText
public class ElementText
A helper class to get formatted value out of XML element text.
Constructor Summary | |
---|---|
ElementText()
|
Method Summary | ||
---|---|---|
static boolean |
getBoolean(boolean defaultValue,
XMLEventParser parser)
|
|
protected static boolean |
getBoolean(boolean defaultValue,
XMLEventParser parser,
boolean mandatory)
|
|
protected static Date |
getDate(String pattern,
Date defaultValue,
boolean mandatory,
XMLEventParser parser)
|
|
static Date |
getDate(String pattern,
Date defaultValue,
XMLEventParser parser)
|
|
protected static Dimension |
getDimension(Dimension defaultValue,
boolean mandatory,
XMLEventParser parser)
|
|
static Dimension |
getDimension(Dimension defaultValue,
XMLEventParser parser)
|
|
static double |
getDouble(double defaultValue,
XMLEventParser parser)
|
|
protected static double |
getDouble(double defaultValue,
XMLEventParser parser,
boolean mandatory)
|
|
static
|
getEnum(T defaultValue,
Class<T> enumType,
XMLEventParser parser)
|
|
protected static
|
getEnum(T defaultValue,
Class<T> enumType,
XMLEventParser parser,
boolean mandatory)
|
|
static int |
getInt(int defaultValue,
XMLEventParser parser)
|
|
protected static int |
getInt(int defaultValue,
XMLEventParser parser,
boolean mandatory)
|
|
static int[] |
getIntArray(int[] defaultValue,
XMLEventParser parser)
|
|
protected static int[] |
getIntArray(int[] defaultValue,
XMLEventParser parser,
boolean mandatory)
|
|
static long |
getLong(long defaultValue,
XMLEventParser parser)
|
|
protected static long |
getLong(long defaultValue,
XMLEventParser parser,
boolean mandatory)
|
|
static boolean |
getMandatoryBoolean(XMLEventParser parser)
|
|
static Date |
getMandatoryDate(String pattern,
XMLEventParser parser)
|
|
static Dimension |
getMandatoryDimension(XMLEventParser parser)
|
|
static double |
getMandatoryDouble(XMLEventParser parser)
|
|
static
|
getMandatoryEnum(Class<T> enumType,
XMLEventParser parser)
|
|
static int |
getMandatoryInt(XMLEventParser parser)
|
|
static int[] |
getMandatoryIntArray(XMLEventParser parser)
|
|
static long |
getMandatoryLong(XMLEventParser parser)
|
|
static String |
getMandatoryMultilineText(XMLEventParser parser)
Get a mandatory multi-line text. |
|
static Point |
getMandatoryPoint(XMLEventParser parser)
|
|
static Rectangle |
getMandatoryRectangle(XMLEventParser parser)
|
|
static String |
getMandatoryString(XMLEventParser parser)
Get the current text from the given parser. |
|
static String |
getMultilineText(String defaultValue,
XMLEventParser parser)
Get a multi-line text. |
|
protected static String |
getMultilineText(String defaultValue,
XMLEventParser parser,
boolean mandatory)
|
|
protected static Point |
getPoint(Point defaultValue,
boolean mandatory,
XMLEventParser parser)
|
|
static Point |
getPoint(Point defaultValue,
XMLEventParser parser)
|
|
protected static Rectangle |
getRectangle(Rectangle defaultValue,
boolean mandatory,
XMLEventParser parser)
|
|
static Rectangle |
getRectangle(Rectangle defaultValue,
XMLEventParser parser)
|
|
static String |
getString(String defaultValue,
XMLEventParser parser)
Get the current text from the given parser. |
|
protected static String |
getString(String defaultValue,
XMLEventParser parser,
boolean mandatory)
|
|
static String |
getString(XMLEventParser parser)
Get the current text from the given parser. |
|
protected static String |
getTrimmedText(boolean mandatory,
XMLEventParser parser)
|
|
static void |
simpleElementMultiline(String uri,
String tag,
String text,
XMLSerializer serilalizer)
|
|
static String |
trimMultiLine(String str)
Remove extra whitespaces that were added by the XMLSerializer.charactersMultiLine(text) method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ElementText()
Method Detail |
---|
public static String getString(XMLEventParser parser) throws XMLParseException
parser
- the parser.
XMLParseException
public static String getString(String defaultValue, XMLEventParser parser) throws XMLParseException
defaultValue
- the value to return if no text is defined.parser
- the parser.
XMLParseException
public static String getMandatoryString(XMLEventParser parser) throws XMLParseException
parser
- the parser.
XMLParseException
- if no text is defined.public static String getMultilineText(String defaultValue, XMLEventParser parser) throws XMLParseException
XMLSerializer.charactersMultiLine(String text)
method.
defaultValue
- the value to return if no text is defined.parser
- the parser.
XMLParseException
XMLSerializer.charactersMultiLine(String)
public static String getMandatoryMultilineText(XMLEventParser parser) throws XMLParseException
XMLSerializer.charactersMultiLine(String text)
method.
If there is no current text or if this text is only made of white spaces, an exception is throw saying that this text is mandatory.
parser
- the parser.
XMLParseException
- if no text is defined.XMLSerializer.charactersMultiLine(String)
public static int getInt(int defaultValue, XMLEventParser parser) throws XMLParseException
XMLParseException
public static int getMandatoryInt(XMLEventParser parser) throws XMLParseException
XMLParseException
public static <T extends Enum<T>> T getEnum(T defaultValue, Class<T> enumType, XMLEventParser parser) throws XMLParseException
XMLParseException
public static <T extends Enum<T>> T getMandatoryEnum(Class<T> enumType, XMLEventParser parser) throws XMLParseException
XMLParseException
public static double getDouble(double defaultValue, XMLEventParser parser) throws XMLParseException
XMLParseException
public static double getMandatoryDouble(XMLEventParser parser) throws XMLParseException
XMLParseException
public static int[] getIntArray(int[] defaultValue, XMLEventParser parser) throws XMLParseException
XMLParseException
public static int[] getMandatoryIntArray(XMLEventParser parser) throws XMLParseException
XMLParseException
public static long getLong(long defaultValue, XMLEventParser parser) throws XMLParseException
XMLParseException
public static long getMandatoryLong(XMLEventParser parser) throws XMLParseException
XMLParseException
public static boolean getBoolean(boolean defaultValue, XMLEventParser parser) throws XMLParseException
XMLParseException
public static boolean getMandatoryBoolean(XMLEventParser parser) throws XMLParseException
XMLParseException
public static Point getPoint(Point defaultValue, XMLEventParser parser) throws XMLParseException
XMLParseException
public static Point getMandatoryPoint(XMLEventParser parser) throws XMLParseException
XMLParseException
public static Dimension getDimension(Dimension defaultValue, XMLEventParser parser) throws XMLParseException
XMLParseException
public static Dimension getMandatoryDimension(XMLEventParser parser) throws XMLParseException
XMLParseException
public static Rectangle getRectangle(Rectangle defaultValue, XMLEventParser parser) throws XMLParseException
XMLParseException
public static Rectangle getMandatoryRectangle(XMLEventParser parser) throws XMLParseException
XMLParseException
public static Date getDate(String pattern, Date defaultValue, XMLEventParser parser) throws XMLParseException
XMLParseException
public static Date getMandatoryDate(String pattern, XMLEventParser parser) throws XMLParseException
XMLParseException
protected static String getString(String defaultValue, XMLEventParser parser, boolean mandatory) throws XMLParseException
XMLParseException
protected static String getMultilineText(String defaultValue, XMLEventParser parser, boolean mandatory) throws XMLParseException
XMLParseException
protected static boolean getBoolean(boolean defaultValue, XMLEventParser parser, boolean mandatory) throws XMLParseException
XMLParseException
protected static int getInt(int defaultValue, XMLEventParser parser, boolean mandatory) throws XMLParseException
XMLParseException
protected static <T extends Enum<T>> T getEnum(T defaultValue, Class<T> enumType, XMLEventParser parser, boolean mandatory) throws XMLParseException
XMLParseException
protected static double getDouble(double defaultValue, XMLEventParser parser, boolean mandatory) throws XMLParseException
XMLParseException
protected static int[] getIntArray(int[] defaultValue, XMLEventParser parser, boolean mandatory) throws XMLParseException
XMLParseException
protected static long getLong(long defaultValue, XMLEventParser parser, boolean mandatory) throws XMLParseException
XMLParseException
protected static Dimension getDimension(Dimension defaultValue, boolean mandatory, XMLEventParser parser) throws XMLParseException
XMLParseException
protected static Point getPoint(Point defaultValue, boolean mandatory, XMLEventParser parser) throws XMLParseException
XMLParseException
protected static Rectangle getRectangle(Rectangle defaultValue, boolean mandatory, XMLEventParser parser) throws XMLParseException
XMLParseException
protected static Date getDate(String pattern, Date defaultValue, boolean mandatory, XMLEventParser parser) throws XMLParseException
XMLParseException
protected static String getTrimmedText(boolean mandatory, XMLEventParser parser) throws XMLParseException
XMLParseException
public static final String trimMultiLine(String str)
str
- The multi-line string to be trimmed at each line.
public static void simpleElementMultiline(String uri, String tag, String text, XMLSerializer serilalizer) throws XMLSerializeException
XMLSerializeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |