Package com.itextpdf.text.pdf
Class XfaForm.Xml2Som
- java.lang.Object
-
- com.itextpdf.text.pdf.XfaForm.Xml2Som
-
- Direct Known Subclasses:
XfaForm.AcroFieldsSearch
,XfaForm.Xml2SomDatasets
,XfaForm.Xml2SomTemplate
- Enclosing class:
- XfaForm
public static class XfaForm.Xml2Som extends Object
A class for some basic SOM processing.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
anform
A temporary store for the repetition count.protected HashMap<String,XfaForm.InverseStore>
inverseSearch
The data to do a search from the bottom hierarchy.protected HashMap<String,Node>
name2Node
The mapping of full names to nodes.protected ArrayList<String>
order
The order the names appear in the XML, depth first.protected XfaForm.Stack2<String>
stack
A stack to be used when parsing.
-
Constructor Summary
Constructors Constructor Description Xml2Som()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
escapeSom(String s)
Escapes a SOM string fragment replacing "." with "\.".HashMap<String,XfaForm.InverseStore>
getInverseSearch()
Gets the data to do a search from the bottom hierarchy.HashMap<String,Node>
getName2Node()
Gets the mapping of full names to nodes.ArrayList<String>
getOrder()
Gets the order the names appear in the XML, depth first.static String
getShortName(String s)
Gets the name with the#subform
removed.void
inverseSearchAdd(String unstack)
Adds a SOM name to the search node chain.static void
inverseSearchAdd(HashMap<String,XfaForm.InverseStore> inverseSearch, XfaForm.Stack2<String> stack, String unstack)
Adds a SOM name to the search node chain.String
inverseSearchGlobal(ArrayList<String> parts)
Searches the SOM hierarchy from the bottom.protected String
printStack()
Outputs the stack as the sequence of elements separated by '.'.void
setInverseSearch(HashMap<String,XfaForm.InverseStore> inverseSearch)
Sets the data to do a search from the bottom hierarchy.void
setName2Node(HashMap<String,Node> name2Node)
Sets the mapping of full names to nodes.void
setOrder(ArrayList<String> order)
Sets the order the names appear in the XML, depth firststatic XfaForm.Stack2<String>
splitParts(String name)
Splits a SOM name in the individual parts.static String
unescapeSom(String s)
Unescapes a SOM string fragment replacing "\." with ".".
-
-
-
Field Detail
-
inverseSearch
protected HashMap<String,XfaForm.InverseStore> inverseSearch
The data to do a search from the bottom hierarchy.
-
stack
protected XfaForm.Stack2<String> stack
A stack to be used when parsing.
-
anform
protected int anform
A temporary store for the repetition count.
-
-
Method Detail
-
escapeSom
public static String escapeSom(String s)
Escapes a SOM string fragment replacing "." with "\.".- Parameters:
s
- the unescaped string- Returns:
- the escaped string
-
unescapeSom
public static String unescapeSom(String s)
Unescapes a SOM string fragment replacing "\." with ".".- Parameters:
s
- the escaped string- Returns:
- the unescaped string
-
printStack
protected String printStack()
Outputs the stack as the sequence of elements separated by '.'.- Returns:
- the stack as the sequence of elements separated by '.'
-
getShortName
public static String getShortName(String s)
Gets the name with the#subform
removed.- Parameters:
s
- the long name- Returns:
- the short name
-
inverseSearchAdd
public void inverseSearchAdd(String unstack)
Adds a SOM name to the search node chain.- Parameters:
unstack
- the SOM name
-
inverseSearchAdd
public static void inverseSearchAdd(HashMap<String,XfaForm.InverseStore> inverseSearch, XfaForm.Stack2<String> stack, String unstack)
Adds a SOM name to the search node chain.- Parameters:
inverseSearch
- the start pointstack
- the stack with the separated SOM partsunstack
- the full name
-
inverseSearchGlobal
public String inverseSearchGlobal(ArrayList<String> parts)
Searches the SOM hierarchy from the bottom.- Parameters:
parts
- the SOM parts- Returns:
- the full name or
null
if not found
-
splitParts
public static XfaForm.Stack2<String> splitParts(String name)
Splits a SOM name in the individual parts.- Parameters:
name
- the full SOM name- Returns:
- the split name
-
getOrder
public ArrayList<String> getOrder()
Gets the order the names appear in the XML, depth first.- Returns:
- the order the names appear in the XML, depth first
-
setOrder
public void setOrder(ArrayList<String> order)
Sets the order the names appear in the XML, depth first- Parameters:
order
- the order the names appear in the XML, depth first
-
getName2Node
public HashMap<String,Node> getName2Node()
Gets the mapping of full names to nodes.- Returns:
- the mapping of full names to nodes
-
setName2Node
public void setName2Node(HashMap<String,Node> name2Node)
Sets the mapping of full names to nodes.- Parameters:
name2Node
- the mapping of full names to nodes
-
getInverseSearch
public HashMap<String,XfaForm.InverseStore> getInverseSearch()
Gets the data to do a search from the bottom hierarchy.- Returns:
- the data to do a search from the bottom hierarchy
-
setInverseSearch
public void setInverseSearch(HashMap<String,XfaForm.InverseStore> inverseSearch)
Sets the data to do a search from the bottom hierarchy.- Parameters:
inverseSearch
- the data to do a search from the bottom hierarchy
-
-