public class MathMLContentBuilder extends java.lang.Object implements MathMLDocumentBuilder
Constructor and Description |
---|
MathMLContentBuilder(Jep jep) |
Modifier and Type | Method and Description |
---|---|
org.w3c.dom.Element |
buildChild(Node n,
org.w3c.dom.Document d)
Builds a Element representing a Jep sub-expression.
|
org.w3c.dom.Document |
buildDocument(Node node)
Create a document containing an single math tag with a single child, no namespace is used.
|
org.w3c.dom.Document |
buildDocument(Node node,
boolean useNamespace)
Create a document containing an single math tag with a single child, no namespace is used.
|
org.w3c.dom.Document |
buildDocument(Node node,
boolean useNamespace,
javax.xml.parsers.DocumentBuilder docb)
Create a document containing an single math tag with a single child, if useNamespace
is set then the standard MathML namespace is used.
|
org.w3c.dom.Document |
buildDocument(Node node,
java.lang.String prefix)
Builds a document using a given namespace prefix
|
org.w3c.dom.Document |
buildDocument(Node node,
java.lang.String prefix,
javax.xml.parsers.DocumentBuilder docb) |
org.w3c.dom.Element |
buildMathElement(Node[] nodes,
org.w3c.dom.Document d,
boolean useNamespace)
Builds a <math> element with one child element per node.
|
org.w3c.dom.Element |
buildMathElement(Node[] nodes,
org.w3c.dom.Document d,
java.lang.String prefix)
Builds a <math> element with a single child, the standard MathML namespace and a specified namespace prefix
|
org.w3c.dom.Element |
buildMathElement(Node node,
org.w3c.dom.Document d,
boolean useNamespace)
Builds a <math> element with a single child element, with content mark up for the Jep expression.
|
org.w3c.dom.Element |
buildMathElement(Node node,
org.w3c.dom.Document d,
java.lang.String prefix)
Builds a <math> element with a single child, the standard MathML namespace and a specified namespace prefix
|
org.w3c.dom.Element |
createElement(java.lang.String name,
org.w3c.dom.Document doc)
Create an element using the MAthML namespaces if needed.
|
javax.xml.parsers.DocumentBuilderFactory |
getDocumentBuilderFactory() |
NumberBuilder.DoubleBehaviour |
getDoubleBehaviour() |
FunctionBuilder |
getFunctionBuilder() |
java.lang.String |
getNamespacePrefix() |
NumberBuilder |
getNumberBuilder() |
OperatorBuilder |
getOperatorBuilder() |
VariableBuilder |
getVaribleBuilder() |
org.w3c.dom.Document |
newDocument()
Create an empty document.
|
org.w3c.dom.Document |
newDocumentMathMLDTD()
Create a document with the MathML DTD and a <math> tag as the root element.
|
org.w3c.dom.Document |
newDocumentMathMLDTD(java.lang.String systemID)
Create a document with the MathML DTD with the specified systemID and a <math> tag as the root element.
|
java.lang.String |
putConstant(java.lang.String key,
java.lang.String value) |
java.lang.String |
putEntity(java.lang.String key,
java.lang.String value) |
MathMLFragmentBuilder |
putFunction(java.lang.String key,
MathMLFragmentBuilder value) |
java.lang.String |
putFunction(java.lang.String key,
java.lang.String value) |
MathMLFragmentBuilder |
putOperator(Operator key,
MathMLFragmentBuilder value) |
java.lang.String |
putOperator(Operator key,
java.lang.String value) |
void |
setAttribute(org.w3c.dom.Element e,
java.lang.String name,
java.lang.String value)
Sets an element attribute using namespaces if required.
|
void |
setDocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory dbf) |
void |
setDoubleBehaviour(NumberBuilder.DoubleBehaviour doubleBehaviour)
Sets how double values with integral values are represented.
|
void |
setFunctionBuilder(FunctionBuilder functionBuilder) |
void |
setNamespacePrefix(java.lang.String namespacePrefix) |
void |
setNumberBuilder(NumberBuilder numberBuilder) |
void |
setOperatorBuilder(OperatorBuilder operatorBuilder) |
void |
setVaribleBuilder(VariableBuilder varibleBuilder) |
public MathMLContentBuilder(Jep jep) throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
public org.w3c.dom.Document newDocument()
public org.w3c.dom.Document newDocumentMathMLDTD()
Document jepDoc = db.newDocumentMathMLDTD(); Element e = db.buildChild(jepNode, jepDoc); jepDoc.getDocumentElement().appendChild(e);to add contents.
public org.w3c.dom.Document newDocumentMathMLDTD(java.lang.String systemID)
Document jepDoc = db.newDocumentMathMLDTD(); Element e = db.buildChild(jepNode, jepDoc); jepDoc.getDocumentElement().appendChild(e);to add contents.
systemID
- the systemID to usepublic org.w3c.dom.Document buildDocument(Node node) throws JepException
node
- jep node for expressionJepException
public org.w3c.dom.Document buildDocument(Node node, boolean useNamespace) throws JepException
node
- jep node for expressionuseNamespace
- JepException
public org.w3c.dom.Document buildDocument(Node node, boolean useNamespace, javax.xml.parsers.DocumentBuilder docb) throws JepException
node
- useNamespace
- docb
- JepException
public org.w3c.dom.Document buildDocument(Node node, java.lang.String prefix) throws JepException
node
- prefix
- JepException
public org.w3c.dom.Document buildDocument(Node node, java.lang.String prefix, javax.xml.parsers.DocumentBuilder docb) throws JepException
JepException
public org.w3c.dom.Element buildMathElement(Node node, org.w3c.dom.Document d, boolean useNamespace) throws JepException
node
- Jep expressiond
- the documentuseNamespace
- use the standard MathML namespaceJepException
public org.w3c.dom.Element buildMathElement(Node[] nodes, org.w3c.dom.Document d, boolean useNamespace) throws JepException
nodes
- an array of Jep expressionsd
- the documentuseNamespace
- whether to use the standard MathML namespace.JepException
public org.w3c.dom.Element buildMathElement(Node node, org.w3c.dom.Document d, java.lang.String prefix) throws JepException
node
- Jep expressiond
- the document to create elements inprefix
- the namespace-prefix to use the prefix will be attached to all MathML elements and attributesJepException
public org.w3c.dom.Element buildMathElement(Node[] nodes, org.w3c.dom.Document d, java.lang.String prefix) throws JepException
nodes
- an array of Jep expressionsd
- the document to create elements inprefix
- the namespace-prefix to use the prefix will be attached to all MathML elements and attributesJepException
public org.w3c.dom.Element buildChild(Node n, org.w3c.dom.Document d) throws JepException
buildChild
in interface MathMLDocumentBuilder
n
- the jep noded
- the document to create the element in.JepException
public org.w3c.dom.Element createElement(java.lang.String name, org.w3c.dom.Document doc)
createElement
in interface MathMLDocumentBuilder
name
- local name of element without prefix.doc
- document to create an element in.public void setAttribute(org.w3c.dom.Element e, java.lang.String name, java.lang.String value)
setAttribute
in interface MathMLDocumentBuilder
e
- element to set an attribut ofname
- name of attributevalue
- value of attributepublic NumberBuilder getNumberBuilder()
public void setNumberBuilder(NumberBuilder numberBuilder)
public VariableBuilder getVaribleBuilder()
public void setVaribleBuilder(VariableBuilder varibleBuilder)
public java.lang.String putConstant(java.lang.String key, java.lang.String value)
public java.lang.String putEntity(java.lang.String key, java.lang.String value)
public MathMLFragmentBuilder putOperator(Operator key, MathMLFragmentBuilder value)
public java.lang.String putOperator(Operator key, java.lang.String value)
public MathMLFragmentBuilder putFunction(java.lang.String key, MathMLFragmentBuilder value)
public java.lang.String putFunction(java.lang.String key, java.lang.String value)
public javax.xml.parsers.DocumentBuilderFactory getDocumentBuilderFactory()
public void setDocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory dbf)
public java.lang.String getNamespacePrefix()
public void setNamespacePrefix(java.lang.String namespacePrefix)
public FunctionBuilder getFunctionBuilder()
public void setFunctionBuilder(FunctionBuilder functionBuilder)
public OperatorBuilder getOperatorBuilder()
public void setOperatorBuilder(OperatorBuilder operatorBuilder)
public NumberBuilder.DoubleBehaviour getDoubleBehaviour()
public void setDoubleBehaviour(NumberBuilder.DoubleBehaviour doubleBehaviour)
doubleBehaviour
- Copyright © 2018 Singular Systems http://www.singularsys.com/jep