Package com.lowagie.text.pdf
Class XfaForm.Xml2Som
- java.lang.Object
-
- com.lowagie.text.pdf.XfaForm.Xml2Som
-
- Direct Known Subclasses:
XfaForm.AcroFieldsSearch
,XfaForm.Xml2SomDatasets
,XfaForm.Xml2SomTemplate
- Enclosing class:
- XfaForm
public static class XfaForm.Xml2Som extends java.lang.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 java.util.Map<java.lang.String,XfaForm.InverseStore>
inverseSearch
The data to do a search from the bottom hierarchy.protected java.util.Map<java.lang.String,org.w3c.dom.Node>
name2Node
The mapping of full names to nodes.protected java.util.List<java.lang.String>
order
The order the names appear in the XML, depth first.protected XfaForm.Stack2
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 void
addSomNameToSearchNodeChain(java.util.Map<java.lang.String,XfaForm.InverseStore> inverseSearch, XfaForm.Stack2 stack, java.lang.String unstack)
Adds a SOM name to the search node chain.static java.lang.String
escapeSom(java.lang.String s)
Escapes a SOM string fragment replacing "." with "\.".java.util.Map<java.lang.String,XfaForm.InverseStore>
getInverseSearchData()
Gets the data to do a search from the bottom hierarchy.java.util.List<java.lang.String>
getNamesOrder()
Gets the order the names appear in the XML, depth first.java.util.Map<java.lang.String,org.w3c.dom.Node>
getNodesByName()
Gets the mapping of full names to nodes.static java.lang.String
getShortName(java.lang.String s)
Gets the name with the#subform
removed.java.lang.String
inverseSearch(java.util.List<java.lang.String> parts)
Searches the SOM hierarchy from the bottom.void
inverseSearchAdd(java.lang.String unstack)
Adds a SOM name to the search node chain.protected java.lang.String
printStack()
Outputs the stack as the sequence of elements separated by '.'.void
setInverseSearchData(java.util.Map<java.lang.String,XfaForm.InverseStore> inverseSearch)
Sets the data to do a search from the bottom hierarchy.void
setNamesOrder(java.util.List<java.lang.String> order)
Sets the order the names appear in the XML, depth firstvoid
setNodesByName(java.util.Map<java.lang.String,org.w3c.dom.Node> name2Node)
Sets the mapping of full names to nodes.static XfaForm.Stack2
splitParts(java.lang.String name)
Splits a SOM name in the individual parts.static java.lang.String
unescapeSom(java.lang.String s)
Unescapes a SOM string fragment replacing "\." with ".".
-
-
-
Field Detail
-
order
protected java.util.List<java.lang.String> order
The order the names appear in the XML, depth first.
-
name2Node
protected java.util.Map<java.lang.String,org.w3c.dom.Node> name2Node
The mapping of full names to nodes.
-
inverseSearch
protected java.util.Map<java.lang.String,XfaForm.InverseStore> inverseSearch
The data to do a search from the bottom hierarchy.
-
stack
protected XfaForm.Stack2 stack
A stack to be used when parsing.
-
anform
protected int anform
A temporary store for the repetition count.
-
-
Method Detail
-
escapeSom
public static java.lang.String escapeSom(java.lang.String s)
Escapes a SOM string fragment replacing "." with "\.".- Parameters:
s
- the unescaped string- Returns:
- the escaped string
-
unescapeSom
public static java.lang.String unescapeSom(java.lang.String s)
Unescapes a SOM string fragment replacing "\." with ".".- Parameters:
s
- the escaped string- Returns:
- the unescaped string
-
getShortName
public static java.lang.String getShortName(java.lang.String s)
Gets the name with the#subform
removed.- Parameters:
s
- the long name- Returns:
- the short name
-
addSomNameToSearchNodeChain
public static void addSomNameToSearchNodeChain(java.util.Map<java.lang.String,XfaForm.InverseStore> inverseSearch, XfaForm.Stack2 stack, java.lang.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
-
splitParts
public static XfaForm.Stack2 splitParts(java.lang.String name)
Splits a SOM name in the individual parts.- Parameters:
name
- the full SOM name- Returns:
- the split name
-
printStack
protected java.lang.String printStack()
Outputs the stack as the sequence of elements separated by '.'.- Returns:
- the stack as the sequence of elements separated by '.'
-
inverseSearchAdd
public void inverseSearchAdd(java.lang.String unstack)
Adds a SOM name to the search node chain.- Parameters:
unstack
- the SOM name
-
inverseSearch
public java.lang.String inverseSearch(java.util.List<java.lang.String> parts)
Searches the SOM hierarchy from the bottom.- Parameters:
parts
- the SOM parts- Returns:
- the full name or
null
if not found
-
getNamesOrder
public java.util.List<java.lang.String> getNamesOrder()
Gets the order the names appear in the XML, depth first.- Returns:
- the order the names appear in the XML, depth first
-
setNamesOrder
public void setNamesOrder(java.util.List<java.lang.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
-
getNodesByName
public java.util.Map<java.lang.String,org.w3c.dom.Node> getNodesByName()
Gets the mapping of full names to nodes.- Returns:
- the mapping of full names to nodes
-
setNodesByName
public void setNodesByName(java.util.Map<java.lang.String,org.w3c.dom.Node> name2Node)
Sets the mapping of full names to nodes.- Parameters:
name2Node
- the mapping of full names to nodes
-
getInverseSearchData
public java.util.Map<java.lang.String,XfaForm.InverseStore> getInverseSearchData()
Gets the data to do a search from the bottom hierarchy.- Returns:
- the data to do a search from the bottom hierarchy
-
setInverseSearchData
public void setInverseSearchData(java.util.Map<java.lang.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
-
-