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 |
(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(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
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 static java.lang.String toMathML(ASTNode astNode)
ASTNode
the mathML.astNode
- the ASTNode
to serialize as mathMLpublic boolean isSBMLNamespaceNeeded(ASTNode astNode)
public void compile(ASTNode astNode)
ASTNode
and produce an XMLStreamWriter representing this node in mathML.SBMLException
- if any problems occur while checking the ASTNode tree.private void compileNegativeInfinity(ASTNode astNode)
private void compilePositiveInfinity(ASTNode astNode)
private void compileNotANumber(ASTNode astNode)
private void compilePi(ASTNode astNode)
private void compileExponentiale(ASTNode astNode)
private void compileCSymbol(ASTNode astNode)
private void compileInteger(ASTNode astNode)
private void compileReal(ASTNode astNode)
private void compileReal_e(ASTNode astNode)
private void compileRational(ASTNode astNode)
private void compileCi(ASTNode astNode)
private void compileElement(ASTNode astNode)
private void compileFunctionElement(ASTNode astNode)
private void compileRootElement(ASTNode astNode)
private void compileLambda(ASTNode astNode)
private void compileBvar(ASTNode arg)
private void compilePiecewise(ASTNode astNode)
private void compileLog(ASTNode astNode)
private void compileConstantElement(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)
private void compileLogicalOperator(ASTNode astNode)
private void compileVector(ASTNode astNode)
private void function(java.lang.String functionName, java.util.List<ASTNode> args)
private void function(java.lang.String functionName, ASTNode... args)
private void compileUserFunction(ASTNode astNode)
private void writeEndElement()
public static void main(java.lang.String[] args)