use of org.hl7.fhir.utilities.xhtml.NodeType in project org.hl7.fhir.core by hapifhir.
the class XhtmlNode method addComment.
public XhtmlNode addComment(String content) {
if (!(nodeType == NodeType.Element || nodeType == NodeType.Document))
throw new Error("Wrong node type");
XhtmlNode node = new XhtmlNode(NodeType.Comment);
node.setContent(content);
childNodes.add(node);
return node;
}
use of org.hl7.fhir.utilities.xhtml.NodeType in project org.hl7.fhir.core by hapifhir.
the class XhtmlNode method addTag.
public XhtmlNode addTag(int index, String name) {
if (!(nodeType == NodeType.Element || nodeType == NodeType.Document))
throw new Error("Wrong node type. is " + nodeType.toString());
XhtmlNode node = new XhtmlNode(NodeType.Element);
if (inPara || name.equals("p")) {
node.inPara = true;
}
if (inLink || name.equals("a")) {
node.inLink = true;
}
node.setName(name);
childNodes.add(index, node);
return node;
}
use of org.hl7.fhir.utilities.xhtml.NodeType in project org.hl7.fhir.core by hapifhir.
the class XhtmlNode method addDocType.
public XhtmlNode addDocType(String content) {
if (!(nodeType == NodeType.Document))
throw new Error("Wrong node type");
XhtmlNode node = new XhtmlNode(NodeType.DocType);
node.setContent(content);
childNodes.add(node);
return node;
}
use of org.hl7.fhir.utilities.xhtml.NodeType in project org.hl7.fhir.core by hapifhir.
the class XhtmlNode method addInstruction.
public XhtmlNode addInstruction(String content) {
if (!(nodeType == NodeType.Document))
throw new Error("Wrong node type");
XhtmlNode node = new XhtmlNode(NodeType.Instruction);
node.setContent(content);
childNodes.add(node);
return node;
}
use of org.hl7.fhir.utilities.xhtml.NodeType in project org.hl7.fhir.core by hapifhir.
the class XhtmlNode method addText.
public XhtmlNode addText(int index, String content) {
if (!(nodeType == NodeType.Element || nodeType == NodeType.Document))
throw new Error("Wrong node type");
if (content == null)
throw new Error("Content cannot be null");
XhtmlNode node = new XhtmlNode(NodeType.Text);
node.setContent(content);
childNodes.add(index, node);
return node;
}
Aggregations