public final class PBCreateNodeHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static FeatureTreeNode |
addBoxFeature(String name,
PDRectangle box,
FeatureTreeNode parent)
Creates feature node for boxes
|
static FeatureTreeNode |
addDeviceColorSpaceNode(String name,
PDColor color,
FeatureTreeNode parent,
FeatureExtractionResult collection)
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 FeatureTreeNode |
createDateNode(String nodeName,
FeatureTreeNode parent,
Calendar date,
FeatureExtractionResult collection)
Creates node with date value formatted in XML format from the given
Calendar
|
static String |
getStringFromBase(COSBase baseParam)
Gets String value from COSBase class
|
static byte[] |
inputStreamToByteArray(InputStream is)
Generates byte array with contents of a stream
|
static void |
parseFloatMatrix(float[][] array,
FeatureTreeNode parent) |
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 FeatureTreeNode |
parseMetadata(PDMetadata metadata,
String nodeName,
FeatureTreeNode parent,
FeatureExtractionResult collection)
Creates FeatureTreeNode with name
nodeName, parent
parent, and content which is a stream r epresentation of the
metadata content. |
public static FeatureTreeNode createDateNode(String nodeName, FeatureTreeNode parent, Calendar date, FeatureExtractionResult collection) throws FeatureParsingException
nodeName - name of the created nodeparent - parent element for created nodedate - the given date as Calendar classcollection - collection for which this node createsFeatureParsingExceptionpublic static String getStringFromBase(COSBase baseParam)
baseParam - COSBase objectpublic static FeatureTreeNode addBoxFeature(String name, PDRectangle box, FeatureTreeNode parent) throws FeatureParsingException
name - name of the nodebox - PDRectangle object represents the boxparent - parent element for the created nodeFeatureParsingExceptionpublic 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, PDColor color, FeatureTreeNode parent, FeatureExtractionResult collection) throws FeatureParsingException
name - name for the created nodecolor - PDColor class represents device color space for creating nodeparent - parent node for the creating nodecollection - features collection in which parent situatedFeatureParsingExceptionpublic 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 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 FeatureTreeNode parseMetadata(PDMetadata metadata, String nodeName, FeatureTreeNode parent, FeatureExtractionResult collection) throws FeatureParsingException
nodeName, parent
parent, and content which is a stream r epresentation of the
metadata content. If there is an exception during getting
metadata, then it will create node with errorID and error for this
situation.metadata - PDMetadata class from which metadata will be takennodeName - name for the created nodecollection - collection for the created nodeFeatureParsingException - occurs when wrong features tree node constructspublic static void parseFloatMatrix(float[][] array,
FeatureTreeNode parent)
throws FeatureParsingException
FeatureParsingExceptionCopyright © 2015–2017 The veraPDF Consortium. All rights reserved.