Package net.sf.okapi.filters.icml
Class ICMLContext
- java.lang.Object
-
- net.sf.okapi.filters.icml.ICMLContext
-
public class ICMLContext extends Object
-
-
Constructor Summary
Constructors Constructor Description ICMLContext(boolean isReferent, Node topNode)Create a new context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCode(Code code)voidaddCode(Node node)voidaddContent(Element elem)Adds a Content element to the text unit.voidaddEndTag(Element elem)voidaddReference(String key, net.sf.okapi.filters.icml.NodeReference ref)voidaddStartTag(Element elem)booleanaddToQueue(List<Event> queue, boolean evenIfEmpty)Adds the text unit to the given queue.StringbuildEndTag(Element elem)StringbuildStartTag(Element elem)If the tag has no contents, it will return a self closing tag.StringbuildStartTag(Element elem, boolean selfClosing)voidenterScope(Node scopeNode, String tuId)NodegetScopeNode()ICMLSkeletongetSkeleton()NodegetTopNode()booleaninScope()voidleaveScope()
-
-
-
Constructor Detail
-
ICMLContext
public ICMLContext(boolean isReferent, Node topNode)Create a new context.- Parameters:
rootNode- Node when starting embedded context. Should be null for the top-level context.
-
-
Method Detail
-
getTopNode
public Node getTopNode()
-
getScopeNode
public Node getScopeNode()
-
getSkeleton
public ICMLSkeleton getSkeleton()
-
leaveScope
public void leaveScope()
-
inScope
public boolean inScope()
-
addToQueue
public boolean addToQueue(List<Event> queue, boolean evenIfEmpty)
Adds the text unit to the given queue.- Parameters:
queue- the event queue where to add the event.evenIfEmpty- true to create a TU event with empty content.- Returns:
- true if a text unit with possibly inline codes was added, false otherwise.
-
addContent
public void addContent(Element elem)
Adds a Content element to the text unit.- Parameters:
elem- the Content element node.
-
addCode
public void addCode(Code code)
-
addCode
public void addCode(Node node)
-
addReference
public void addReference(String key, net.sf.okapi.filters.icml.NodeReference ref)
-
addStartTag
public void addStartTag(Element elem)
-
addEndTag
public void addEndTag(Element elem)
-
buildStartTag
public String buildStartTag(Element elem)
If the tag has no contents, it will return a self closing tag.
-
-