org.sbml.jsbml.math.compiler
public class MathMLXMLStreamCompiler extends java.lang.Object
ASTNode2
to 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(ASTNode2 node)
Compiles this
ASTNode2 and produce an XMLStreamWriter representing this node in mathML. |
private void |
compileBvar(ASTQualifierNode bvar) |
private void |
compileCi(ASTCSymbolBaseNode ci) |
private void |
compileConstantElement(ASTNode2 astNode) |
private void |
compileCSymbol(ASTCSymbolNode csymbol) |
private void |
compileElement(ASTFunction astNode) |
private void |
compileElement(java.lang.String string,
ASTFunction function) |
private void |
compileExponentiale(ASTConstantNumber astConstantNumber) |
private void |
compileFunctionElement(ASTFunction astNode) |
private void |
compileInteger(ASTCnIntegerNode integer) |
private void |
compileLambda(ASTLambdaFunctionNode lambda) |
private void |
compileLog(ASTLogarithmNode log) |
private void |
compileLogicalOperator(ASTLogicalOperatorNode operator) |
private void |
compileNegativeInfinity(ASTCnRealNode real) |
private void |
compileNotANumber(ASTCnRealNode astNode) |
private void |
compilePi(ASTConstantNumber astNode) |
private void |
compilePiecewise(ASTPiecewiseFunctionNode piecewise) |
private void |
compilePositiveInfinity(ASTCnRealNode astNode) |
private void |
compileRational(ASTCnRationalNode rational) |
private void |
compileReal_e(ASTCnExponentialNode exponential) |
private void |
compileReal(ASTCnRealNode real) |
private void |
compileRelationalOperator(ASTRelationalOperatorNode operator) |
private void |
compileRootElement(ASTRootNode root) |
private void |
compileUserFunction(ASTCiFunctionNode astNode) |
private void |
compileVector(ASTFunction astNode) |
private void |
function(java.lang.String functionName,
ASTNode2... args) |
private void |
function(java.lang.String functionName,
java.util.List<ASTNode2> args) |
boolean |
isSBMLNamespaceNeeded(ASTNode2 astNode) |
static void |
main(java.lang.String[] args) |
static java.lang.String |
toMathML(ASTNode2 astNode)
Writes an
ASTNode2 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 void main(java.lang.String[] args)
args
- public static java.lang.String toMathML(ASTNode2 astNode)
ASTNode2
the mathML.astNode
- the ASTNode2
to serialize as mathMLpublic void compile(ASTNode2 node)
ASTNode2
and produce an XMLStreamWriter representing this node in mathML.node
- SBMLException
- if any problems occur while checking the ASTNode2 tree.private void compileBvar(ASTQualifierNode bvar)
bvar
- private void compileCi(ASTCSymbolBaseNode ci)
ci
- private void compileConstantElement(ASTNode2 astNode)
astNode
- private void compileCSymbol(ASTCSymbolNode csymbol)
csymbol
- private void compileElement(ASTFunction astNode)
astNode
- private void compileElement(java.lang.String string, ASTFunction function)
string
- element namefunction
- the node containing all the element informationprivate void compileExponentiale(ASTConstantNumber astConstantNumber)
astConstantNumber
- private void compileFunctionElement(ASTFunction astNode)
astNode
- private void compileInteger(ASTCnIntegerNode integer)
integer
- private void compileLambda(ASTLambdaFunctionNode lambda)
lambda
- private void compileLog(ASTLogarithmNode log)
log
- private void compileLogicalOperator(ASTLogicalOperatorNode operator)
operator
- private void compileNegativeInfinity(ASTCnRealNode real)
real
- private void compileNotANumber(ASTCnRealNode astNode)
astNode
- private void compilePi(ASTConstantNumber astNode)
astNode
- private void compilePiecewise(ASTPiecewiseFunctionNode piecewise)
piecewise
- private void compilePositiveInfinity(ASTCnRealNode astNode)
astNode
- private void compileRational(ASTCnRationalNode rational)
rational
- private void compileReal(ASTCnRealNode real)
real
- private void compileReal_e(ASTCnExponentialNode exponential)
exponential
- private void compileRelationalOperator(ASTRelationalOperatorNode operator)
operator
- private void compileRootElement(ASTRootNode root)
root
- private void compileUserFunction(ASTCiFunctionNode astNode)
astNode
- private void compileVector(ASTFunction astNode)
astNode
- private void function(java.lang.String functionName, ASTNode2... args)
functionName
- args
- private void function(java.lang.String functionName, java.util.List<ASTNode2> args)
functionName
- args
- public boolean isSBMLNamespaceNeeded(ASTNode2 astNode)
astNode
- private void writeEndElement()