Class XJDFToJDFImpl
- java.lang.Object
-
- org.cip4.jdflib.elementwalker.ElementWalker
-
- org.cip4.jdflib.elementwalker.PackageElementWalker
-
- org.cip4.jdflib.extensions.xjdfwalker.xjdftojdf.XJDFToJDFImpl
-
- Direct Known Subclasses:
XJDFToJDFConverter
public class XJDFToJDFImpl extends PackageElementWalker
-
-
Field Summary
-
Fields inherited from class org.cip4.jdflib.elementwalker.ElementWalker
theFactory
-
-
Constructor Summary
Constructors Constructor Description XJDFToJDFImpl(JDFDoc template)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidattributesToSpan(KElement e)protected KElementattributeToSpan(KElement e, java.lang.String name)static booleancanConvert(KElement xjdf)protected BaseWalkerconstructWalker(java.lang.String name)protected JDFDocconvert(KElement _xjdf)protected voidconvertTilde(KElement e2)protected voidconvertUnits(KElement element)protected JDFNodecreateProductRoot()make sure we have a product in case we have multiple nodesJDFElement.EnumVersiongetVersion()JDFElement.EnumVersiongetXJDFVersion()booleanisbConvertTilde()Getter for bConvertTilde attribute.booleanisConvertUnits()Getter for convertUnits attribute.booleanisCreateProduct()Getter for createProduct attribute.booleanisHeuristicLink()booleanisTypeLinks()Getter for typeLinks attribute.protected voidmoveAmountsToLink(JDFAttributeMap partmap, JDFAttributeMap map, JDFResourceLink rl)protected voidpostConvert(JDFNode theNode)protected XJDFHelperpresplit(KElement e)protected KElementreparse(KElement xjdf)voidreset(JDFDoc template)voidresetProduct()reset the product so that multiple independent product xjdf elements can be mergedvoidsetConvertTilde(boolean b)if true tildes are converted to pairs in xjdf 2.0voidsetConvertUnits(boolean convertUnits)Setter for convertUnits attribute.voidsetCreateProduct(boolean createProduct)Setter for createProduct attribute.voidsetHeuristicLink(boolean heuristicLink)if true, we will find a @Usage for sets with no Usage using fuzzy heuristicsvoidsetTypeLinks(boolean typeLinks)Setter for typeLinks attribute.voidsetVersion(JDFElement.EnumVersion version)-
Methods inherited from class org.cip4.jdflib.elementwalker.PackageElementWalker
getFactory
-
Methods inherited from class org.cip4.jdflib.elementwalker.ElementWalker
toString, walkTree, walkTreeKidsFirst
-
-
-
-
Constructor Detail
-
XJDFToJDFImpl
public XJDFToJDFImpl(JDFDoc template)
- Parameters:
template- the jdfdoc to fill this into
-
-
Method Detail
-
setVersion
public void setVersion(JDFElement.EnumVersion version)
- Parameters:
version- the version to set - unused
-
constructWalker
protected BaseWalker constructWalker(java.lang.String name)
- Overrides:
constructWalkerin classPackageElementWalker- Returns:
- See Also:
PackageElementWalker.constructWalker(java.lang.String)
-
isCreateProduct
public boolean isCreateProduct()
Getter for createProduct attribute.- Returns:
- the createProduct
-
setCreateProduct
public void setCreateProduct(boolean createProduct)
Setter for createProduct attribute.- Parameters:
createProduct- the createProduct to set
-
isConvertUnits
public boolean isConvertUnits()
Getter for convertUnits attribute.- Returns:
- the convertUnits
-
setConvertUnits
public void setConvertUnits(boolean convertUnits)
Setter for convertUnits attribute.- Parameters:
convertUnits- the convertUnits to set
-
isbConvertTilde
public boolean isbConvertTilde()
Getter for bConvertTilde attribute.- Returns:
- the bConvertTilde
-
reset
public void reset(JDFDoc template)
-
resetProduct
public void resetProduct()
reset the product so that multiple independent product xjdf elements can be merged
-
postConvert
protected void postConvert(JDFNode theNode)
- Parameters:
theNode-
-
presplit
protected XJDFHelper presplit(KElement e)
-
canConvert
public static boolean canConvert(KElement xjdf)
- Parameters:
xjdf-- Returns:
- true if the element can be converted
-
createProductRoot
protected JDFNode createProductRoot()
make sure we have a product in case we have multiple nodes- Returns:
-
convertUnits
protected void convertUnits(KElement element)
- Parameters:
element-
-
convertTilde
protected void convertTilde(KElement e2)
- Parameters:
e2-
-
getVersion
public JDFElement.EnumVersion getVersion()
- Returns:
- the version
-
attributesToSpan
protected void attributesToSpan(KElement e)
- Parameters:
e-
-
attributeToSpan
protected KElement attributeToSpan(KElement e, java.lang.String name)
- Parameters:
e-name-- Returns:
- the new span element
-
moveAmountsToLink
protected void moveAmountsToLink(JDFAttributeMap partmap, JDFAttributeMap map, JDFResourceLink rl)
- Parameters:
partmap-map-rl-
-
setConvertTilde
public void setConvertTilde(boolean b)
if true tildes are converted to pairs in xjdf 2.0- Parameters:
b-
-
setTypeLinks
public void setTypeLinks(boolean typeLinks)
Setter for typeLinks attribute. if true, we will only create links that are appropriate for the respective type or types- Parameters:
heuristicLink- the typeLinks to set
-
isTypeLinks
public boolean isTypeLinks()
Getter for typeLinks attribute.- Returns:
- the typeLinks
-
isHeuristicLink
public boolean isHeuristicLink()
- Returns:
-
setHeuristicLink
public void setHeuristicLink(boolean heuristicLink)
if true, we will find a @Usage for sets with no Usage using fuzzy heuristics- Parameters:
heuristicLink-
-
getXJDFVersion
public JDFElement.EnumVersion getXJDFVersion()
-
-