org.sbml.jsbml.util.compilers
public class MathMLXMLStreamCompiler extends java.lang.Object
ASTNode
the mathML.Modifier and Type | Field and Description |
---|---|
private FindUnitsCompiler |
findUnitsCompiler |
private java.lang.String |
indent |
private org.apache.log4j.Logger |
logger
A
Logger for this class. |
(package private) java.text.DecimalFormat |
realFormat
Formats the real number in a valid way for mathML.
|
private javax.xml.stream.XMLStreamWriter |
writer |
Constructor and Description |
---|
MathMLXMLStreamCompiler() |
MathMLXMLStreamCompiler(java.lang.String indent) |
MathMLXMLStreamCompiler(javax.xml.stream.XMLStreamWriter writer,
java.lang.String indent)
Create a new MathMLXMLStreamCompiler.
|
Modifier and Type | Method and Description |
---|---|
void |
compile(ASTNode astNode)
Compiles this
ASTNode and produce an XMLStreamWriter representing this node in mathML. |
private void |
compileBvar(ASTNode arg) |
private void |
compileCi(ASTNode astNode) |
private void |
compileConstantElement(ASTNode astNode) |
private void |
compileCSymbol(ASTNode astNode) |
private void |
compileElement(ASTNode astNode) |
private void |
compileElement(java.lang.String string,
ASTNode astNode) |
private void |
compileExponentiale(ASTNode astNode) |
private void |
compileFunctionElement(ASTNode astNode) |
private void |
compileInteger(ASTNode astNode) |
private void |
compileLambda(ASTNode astNode) |
private void |
compileLog(ASTNode astNode) |
private void |
compileLogicalOperator(ASTNode astNode) |
private void |
compileNegativeInfinity(ASTNode astNode) |
private void |
compileNotANumber(ASTNode astNode) |
private void |
compilePi(ASTNode astNode) |
private void |
compilePiecewise(ASTNode astNode) |
private void |
compilePositiveInfinity(ASTNode astNode) |
private void |
compileRational(ASTNode astNode) |
private void |
compileReal_e(ASTNode astNode) |
private void |
compileReal(ASTNode astNode) |
private void |
compileRelationalOperator(ASTNode astNode) |
private void |
compileRootElement(ASTNode astNode) |
private void |
compileUserFunction(ASTNode astNode) |
private void |
compileVector(ASTNode astNode) |
private void |
function(java.lang.String functionName,
ASTNode... args) |
private void |
function(java.lang.String functionName,
java.util.List<ASTNode> args) |
boolean |
isSBMLNamespaceNeeded(ASTNode astNode) |
static void |
main(java.lang.String[] args) |
static java.lang.String |
toMathML(ASTNode astNode)
Writes an
ASTNode the mathML. |
private void |
writeEndElement() |
private java.lang.String indent
private final javax.xml.stream.XMLStreamWriter writer
private final org.apache.log4j.Logger logger
Logger
for this class.private final FindUnitsCompiler findUnitsCompiler
java.text.DecimalFormat realFormat
public MathMLXMLStreamCompiler(javax.xml.stream.XMLStreamWriter writer, java.lang.String indent)
writer
- the writerindent
- the starting indentationjava.lang.IllegalArgumentException
- if the writer is nullpublic MathMLXMLStreamCompiler(java.lang.String indent) throws javax.xml.stream.XMLStreamException
indent
- javax.xml.stream.XMLStreamException
public MathMLXMLStreamCompiler() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public static java.lang.String toMathML(ASTNode astNode)
ASTNode
the mathML.astNode
- the ASTNode
to serialize as mathMLpublic boolean isSBMLNamespaceNeeded(ASTNode astNode)
astNode
- public void compile(ASTNode astNode)
ASTNode
and produce an XMLStreamWriter representing this node in mathML.astNode
- SBMLException
- if any problems occur while checking the ASTNode tree.private void compileNegativeInfinity(ASTNode astNode)
astNode
- private void compilePositiveInfinity(ASTNode astNode)
astNode
- private void compileNotANumber(ASTNode astNode)
astNode
- private void compilePi(ASTNode astNode)
astNode
- private void compileExponentiale(ASTNode astNode)
astNode
- private void compileCSymbol(ASTNode astNode)
astNode
- private void compileInteger(ASTNode astNode)
astNode
- private void compileReal(ASTNode astNode)
astNode
- private void compileReal_e(ASTNode astNode)
astNode
- private void compileRational(ASTNode astNode)
astNode
- private void compileCi(ASTNode astNode)
astNode
- private void compileElement(ASTNode astNode)
astNode
- private void compileFunctionElement(ASTNode astNode)
astNode
- private void compileRootElement(ASTNode astNode)
astNode
- private void compileLambda(ASTNode astNode)
astNode
- private void compileBvar(ASTNode arg)
arg
- private void compilePiecewise(ASTNode astNode)
astNode
- private void compileLog(ASTNode astNode)
astNode
- private void compileConstantElement(ASTNode astNode)
astNode
- private void compileElement(java.lang.String string, ASTNode astNode)
string
- element nameastNode
- the node containing all the element informationprivate void compileRelationalOperator(ASTNode astNode)
astNode
- private void compileLogicalOperator(ASTNode astNode)
astNode
- private void compileVector(ASTNode astNode)
astNode
- private void function(java.lang.String functionName, java.util.List<ASTNode> args)
functionName
- args
- private void function(java.lang.String functionName, ASTNode... args)
functionName
- args
- private void compileUserFunction(ASTNode astNode)
astNode
- private void writeEndElement()
public static void main(java.lang.String[] args)
args
-