public final class CreateNodeHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
HEIGHT |
static String |
ID |
static String |
WIDTH |
| Modifier and Type | Method and Description |
|---|---|
static FeatureTreeNode |
addBoxFeature(String name,
double[] box,
FeatureTreeNode parent)
Creates feature node for boxes
|
static FeatureTreeNode |
addDeviceColorSpaceNode(String name,
double[] color,
FeatureTreeNode parent,
FeaturesObject object)
Creates new node for device color space
|
static FeatureTreeNode |
addNotEmptyNode(String name,
String value,
FeatureTreeNode parent)
Creates new node with given name and value if both of this parametrs are
not null
|
static void |
addWidthHeightFeatures(double[] box,
FeatureTreeNode parent) |
static FeatureTreeNode |
createDateNode(String nodeName,
FeatureTreeNode parent,
Calendar date,
FeaturesObject object)
Creates node with date value formatted in XML format from the given
Calendar
|
static String |
formatDouble(double value,
int fractionDigits) |
static byte[] |
inputStreamToByteArray(InputStream is)
Generates byte array with contents of a stream
|
static void |
parseIDSet(Set<String> set,
String elementName,
String setName,
FeatureTreeNode root)
Creates elements with name
elementName and attribute id with
values from set and attach them to the root element in
case, when setName is null and to the element with root
parent and name elementName in other case |
static void |
parseMatrix(double[] array,
FeatureTreeNode parent) |
static FeatureTreeNode |
parseMetadata(InputStream metadata,
String nodeName,
FeatureTreeNode parent,
FeaturesObject object) |
public static final String ID
public static final String WIDTH
public static final String HEIGHT
public static FeatureTreeNode createDateNode(String nodeName, FeatureTreeNode parent, Calendar date, FeaturesObject object) throws FeatureParsingException
nodeName - name of the created nodeparent - parent element for created nodedate - the given date as Calendar classFeatureParsingExceptionpublic static FeatureTreeNode addBoxFeature(String name, double[] box, FeatureTreeNode parent) throws FeatureParsingException
name - name of the nodebox - PDRectangle object represents the boxparent - parent element for the created nodeFeatureParsingExceptionpublic static void addWidthHeightFeatures(double[] box,
FeatureTreeNode parent)
throws FeatureParsingException
FeatureParsingExceptionpublic static FeatureTreeNode addNotEmptyNode(String name, String value, FeatureTreeNode parent) throws FeatureParsingException
name - name of the nodevalue - value of the nodeparent - parent of the nodeFeatureParsingExceptionpublic static FeatureTreeNode addDeviceColorSpaceNode(String name, double[] color, FeatureTreeNode parent, FeaturesObject object) throws FeatureParsingException
name - name for the created nodecolor - PDColor class represents device color space for creating nodeparent - parent node for the creating nodeobject - features object which calls this methodFeatureParsingExceptionpublic static void parseIDSet(Set<String> set, String elementName, String setName, FeatureTreeNode root) throws FeatureParsingException
elementName and attribute id with
values from set and attach them to the root element in
case, when setName is null and to the element with root
parent and name elementName in other caseset - set of elements idelementName - element namessetName - name of the parent element for created elements. If null, all
created elements will be attached to the rootroot - root element for the generated parent element for generated
elements or direct paren for generated elements in case of
setName equals to nullFeatureParsingExceptionpublic static FeatureTreeNode parseMetadata(InputStream metadata, String nodeName, FeatureTreeNode parent, FeaturesObject object) throws FeatureParsingException
FeatureParsingExceptionpublic static byte[] inputStreamToByteArray(InputStream is) throws IOException
is - input stream for convertingIOException - If the first byte cannot be read for any reason other than
end of file, or if the input stream has been closed, or if
some other I/O error occurs.public static void parseMatrix(double[] array,
FeatureTreeNode parent)
throws FeatureParsingException
FeatureParsingExceptionpublic static String formatDouble(double value, int fractionDigits)
Copyright © 2015–2017 The veraPDF Consortium. All rights reserved.