public class MathMLParser
extends java.lang.Object
TeXFormula.
JDOM is used for parsing. For each "parse" method found here, there's a
corresponding "build" method in the class org.jdom.input.SaxBuilder.
For more information, see
http://jdom.org .
| Modifier and Type | Method and Description |
|---|---|
protected static TeXFormula |
createSpace(java.lang.String[] attr) |
protected static java.awt.Color |
getColor(java.lang.String s) |
protected static java.util.List<TeXFormula> |
getFormulaList(java.util.List l,
be.ugent.caagt.jmathtex.mathml.Environment env) |
protected static java.lang.Object |
getUnicodeMapping(char unicode) |
static TeXFormula |
parse(java.io.File file,
boolean validate)
Parses a MathML input file identified by a
File. |
static TeXFormula |
parse(java.io.InputStream stream,
boolean validate)
Parses MathML input from the specified
InputStream. |
static TeXFormula |
parse(java.io.InputStream stream,
java.lang.String uri,
boolean validate)
Parses MathML input from the specified
InputStream and URI base. |
static TeXFormula |
parse(java.io.Reader reader,
boolean validate)
Parses MathML input from the specified
Reader. |
static TeXFormula |
parse(java.io.Reader reader,
java.lang.String uri,
boolean validate)
Parses MathML input from the specified
Reader and URI base. |
static TeXFormula |
parse(java.lang.String uri,
boolean validate)
Parses a MathML input file identified by the specified URI.
|
static TeXFormula |
parse(java.net.URL url,
boolean validate)
Parses a MathML input file identified by the specified URL.
|
protected static TeXFormula createSpace(java.lang.String[] attr) throws MathMLException
MathMLExceptionprotected static java.awt.Color getColor(java.lang.String s)
throws MathMLException
MathMLExceptionprotected static java.util.List<TeXFormula> getFormulaList(java.util.List l, be.ugent.caagt.jmathtex.mathml.Environment env) throws MathMLException
MathMLExceptionprotected static java.lang.Object getUnicodeMapping(char unicode)
public static TeXFormula parse(java.io.File file, boolean validate) throws MathMLException, java.io.IOException
File.file - identifies the file to read fromvalidate - whether the input file should be validated firstTeXFormulaMathMLException - if the MathML syntax wasn't correctjava.io.IOException - if there was an error reading the filepublic static TeXFormula parse(java.io.InputStream stream, boolean validate) throws MathMLException, java.io.IOException
InputStream.stream - the stream to read fromvalidate - whether the input file should be validated firstTeXFormulaMathMLException - if the MathML syntax wasn't correctjava.io.IOException - if there was an error reading the filepublic static TeXFormula parse(java.io.InputStream stream, java.lang.String uri, boolean validate) throws MathMLException, java.io.IOException
InputStream and URI base.stream - the stream to read fromuri - base for resolving relative URI'svalidate - whether the input file should be validated firstTeXFormulaMathMLException - if the MathML syntax wasn't correctjava.io.IOException - if there was an error reading the filepublic static TeXFormula parse(java.io.Reader reader, boolean validate) throws MathMLException, java.io.IOException
Reader.reader - the Reader to read fromvalidate - whether the input file should be validated firstTeXFormulaMathMLException - if the MathML syntax wasn't correctjava.io.IOException - if there was an error reading the filepublic static TeXFormula parse(java.io.Reader reader, java.lang.String uri, boolean validate) throws MathMLException, java.io.IOException
Reader and URI base.reader - the Reader to read fromuri - base for resolving relative URI'svalidate - whether the input file should be validated firstTeXFormulaMathMLException - if the MathML syntax wasn't correctjava.io.IOException - if there was an error reading the filepublic static TeXFormula parse(java.lang.String uri, boolean validate) throws MathMLException, java.io.IOException
uri - identifies the file to read fromvalidate - whether the input file should be validated firstTeXFormulaMathMLException - if the MathML syntax wasn't correctjava.io.IOException - if there was an error reading the filepublic static TeXFormula parse(java.net.URL url, boolean validate) throws MathMLException, java.io.IOException
url - identifies the file to read fromvalidate - whether the input file should be validated firstTeXFormulaMathMLException - if the MathML syntax wasn't correctjava.io.IOException - if there was an error reading the file