public class DOMParserHelper extends Object
Modifier and Type | Field and Description |
---|---|
static Pattern |
idPattern |
static Pattern |
rgbPattern |
Constructor and Description |
---|
DOMParserHelper() |
Modifier and Type | Method and Description |
---|---|
static boolean |
parseBoolean(IFXGNode node,
String value,
String name,
boolean defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG String value to a boolean.
|
static double |
parseDouble(IFXGNode node,
String value,
double min,
double max)
Convert an FXG String value to a double and check that the result is
within the specified range (inclusive).
|
static double |
parseDouble(IFXGNode node,
String value,
String name,
double defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG String value to a double.
|
static double |
parseDouble(IFXGNode node,
String value,
String name,
double min,
double max,
double defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG String value to a double and check that the result is
within the specified range (inclusive).
|
static FillMode |
parseFillMode(IFXGNode node,
String value,
FillMode defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG String value to a fillMode enumeration.
|
static float |
parseFloat(IFXGNode node,
String value)
Convert an FXG String value to a float.
|
static float |
parseFloat(IFXGNode node,
String name,
String value,
float defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG String value to a float.
|
static String |
parseIdentifier(IFXGNode node,
String name,
String value,
String defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG String value to a Identifier matching pattern
[a-zA-Z_][a-zA-Z_0-9]*.
|
static int |
parseInt(IFXGNode node,
String value,
int min,
int max)
Convert an FXG String value to an int and check that the result is
within the specified range (inclusive).
|
static int |
parseInt(IFXGNode node,
String value,
String name,
int min,
int max,
int defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG String value to an int and check that the result is
within the specified range (inclusive).
|
static InterpolationMethod |
parseInterpolationMethod(IFXGNode node,
String value,
InterpolationMethod defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG String value to an InterpolationMethod enumeration.
|
static MaskType |
parseMaskType(IFXGNode node,
String value,
MaskType defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG String value to a MaskType enumeration.
|
static double |
parseNumberPercent(IFXGNode node,
String value,
double min,
double max)
Convert an FXG String value to a double after taking care of the % sign.
|
static double |
parseNumberPercent(IFXGNode node,
String value,
String name,
double min,
double max,
double defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG String value to a double after taking care of the % sign.
|
static double |
parseNumberPercentWithSeparateRange(IFXGNode node,
String value,
String name,
double minNumber,
double maxNumber,
double minPercent,
double maxPercent,
double defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG String value to a double after taking care of the % sign.
|
static double |
parsePercent(IFXGNode node,
String value,
String name,
double defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG String value to a double after taking care of the % sign.
|
static int |
parseRGB(IFXGNode node,
String value,
String name,
int defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG hexadecimal color String to an int.
|
static SpreadMethod |
parseSpreadMethod(IFXGNode node,
String value,
SpreadMethod defaultValue,
Collection<ICompilerProblem> problems)
Convert an FXG String value to a SpreadMethod enumeration.
|
public static boolean parseBoolean(IFXGNode node, String value, String name, boolean defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - the FXG String value.name
- - the FXG attribute name.defaultValue
- default value to use in case of any problemproblems
- problem collection used to collect problems occurred within this methodpublic static int parseRGB(IFXGNode node, String value, String name, int defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - an FXG a hexadecimal color String.name
- - the FXG attribute name.defaultValue
- default value to use in case of any problemproblems
- problem collection used to collect problems occurred within this methodpublic static double parseDouble(IFXGNode node, String value, String name, double defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - the FXG String value.name
- - the FXG attribute name.defaultValue
- default value to use in case of any problemproblems
- problem collection used to collect problems occurred within this methodpublic static double parsePercent(IFXGNode node, String value, String name, double defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - the FXG String value.name
- - the FXG attribute name.defaultValue
- default value to use in case of any problemproblems
- problem collection used to collect problems occurred within this methodpublic static double parseNumberPercent(IFXGNode node, String value, String name, double min, double max, double defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - the FXG String value.name
- - the FXG attribute name.min
- - the smallest double value that the result must be greater
or equal to.max
- - the largest double value that the result must be smaller
than or equal to.defaultValue
- - the default double value; if the encountered minor
version is later than the supported minor version and the attribute value
is out-of-range, the default value is returned.problems
- problem collection used to collect problems occurred within this method.public static double parseNumberPercent(IFXGNode node, String value, double min, double max) throws NumberFormatException
node
- - the FXG node.value
- - the FXG String value.min
- - the smallest double value that the result must be greater
or equal to.max
- - the largest double value that the result must be smaller
than or equal to.NumberFormatException
- if the number is not in an acceptable format
or out of bounds defined by min and max.public static double parseNumberPercentWithSeparateRange(IFXGNode node, String value, String name, double minNumber, double maxNumber, double minPercent, double maxPercent, double defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - the FXG String value.minNumber
- - the smallest double value that the result must be greater
or equal to.maxNumber
- - the largest double value that the result must be smaller
than or equal to.defaultValue
- - the default double value; if the encountered minor
version is later than the supported minor version and the attribute value
is out-of-range, the default value is returned.problems
- problem collection used to collect problems occurred within this method.public static double parseDouble(IFXGNode node, String value, double min, double max) throws NumberFormatException
node
- - the FXG node.value
- - the FXG String value.min
- - the smallest double value that the result must be greater
or equal to.max
- - the largest double value that the result must be smaller
than or equal to.NumberFormatException
- if the number is not in an acceptable format
or out of bounds defined by min and max.public static double parseDouble(IFXGNode node, String value, String name, double min, double max, double defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - the FXG String value.name
- - the FXG attribute name.min
- - the smallest double value that the result must be greater
or equal to.max
- - the largest double value that the result must be smaller
than or equal to.defaultValue
- - the default double value; if the encountered minor
version is later than the supported minor version and the attribute value
is out-of-range, the default value is returned.problems
- problem collection used to collect problems occurred within this method.public static float parseFloat(IFXGNode node, String name, String value, float defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - the FXG String value.defaultValue
- default value to use in case of any problemproblems
- problem collection used to collect problems occurred within this methodpublic static float parseFloat(IFXGNode node, String value) throws NumberFormatException
node
- - the FXG node.value
- - the FXG String value.NumberFormatException
- if the number is not in an acceptable format.public static int parseInt(IFXGNode node, String value, String name, int min, int max, int defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - the FXG String value.name
- - the FXG attribute name.min
- - the smallest int value that the result must be greater
or equal to.max
- - the largest int value that the result must be smaller
than or equal to.defaultValue
- - the default int value; if the encountered minor
version is later than the supported minor version and the attribute value
is out-of-range, the default value is returned.problems
- problem collection used to collect problems occurred within this method.public static int parseInt(IFXGNode node, String value, int min, int max) throws NumberFormatException
node
- - the FXG node.value
- - the FXG String value.min
- - the smallest int value that the result must be greater
or equal to.max
- - the largest int value that the result must be smaller
than or equal to.NumberFormatException
- if the number is not in an acceptable format
or out of bounds defined by min and max.public static InterpolationMethod parseInterpolationMethod(IFXGNode node, String value, InterpolationMethod defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - the FXG String valuedefaultValue
- - the FXG InterpolationMethod default valueproblems
- problem collection used to collect problems occurred within this method.public static MaskType parseMaskType(IFXGNode node, String value, MaskType defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - the FXG String valuedefaultValue
- - the FXG MaskType default value; if the encountered
minor version is later than the supported minor version and the attribute
value is out-of-range, the default value is returned.problems
- problem collection used to collect problems occurred within this method.public static FillMode parseFillMode(IFXGNode node, String value, FillMode defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - the FXG String value.defaultValue
- default value to use in case of any problemproblems
- problem collection used to collect problems occurred within this methodpublic static SpreadMethod parseSpreadMethod(IFXGNode node, String value, SpreadMethod defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - the FXG String valuedefaultValue
- - the FXG SpreadMethod default valueproblems
- problem collection used to collect problems occurred within this method.public static String parseIdentifier(IFXGNode node, String name, String value, String defaultValue, Collection<ICompilerProblem> problems)
node
- - the FXG node.value
- - the FXG String valuedefaultValue
- default value to use in case of any problemproblems
- problem collection used to collect problems occurred within this methodCopyright © 2016 The Apache Software Foundation. All rights reserved.