|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwebeq3.util.EquationUtilities
public class EquationUtilities
This utility class provides all the MathML markup generation methods for the equation instance.
| Field Summary | |
|---|---|
static int |
CONTENT
|
static int |
ENTITY_NAMES
|
static int |
ENTITY_OR_NUMERICAL
|
static int |
ESCAPE_ALL
|
static int |
ESCAPE_NONE
|
static int |
ESCAPE_SPECIAL
|
static int |
MIXED_MARKUP
|
static int |
NORMALIZED_PRESENTATION
|
static int |
NUMERICAL_REFERENCES
|
static int |
PACKED
|
static int |
PACKED_AND_ESCAPED
|
static int |
PACKED_AND_WRAPPED
|
static int |
PASS_THROUGH
|
static int |
PRESENTATION
|
static int |
PRETTY_PRINT
|
static int |
REGULAR_PRESENTATION
|
static int |
UNICODE
|
| Constructor Summary | |
|---|---|
EquationUtilities()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
getContentMathML(webeq3.app.Equation eq)
Returns the formatted content MathML markup for the specified equation. |
static java.lang.String |
getDoubleEscapedContentMathML(webeq3.app.Equation eq)
Returns the double escaped packed content MathML markup for the specified equation. |
static java.lang.String |
getDoubleEscapedMathML(webeq3.app.Equation eq)
Returns the double escaped packed MathML markup for the specified equation in which unicode characters have been double escaped, in the format of "&" + EntityName + ";". |
static java.lang.String |
getFormattedMathML(webeq3.app.Equation eq,
int markupType,
int formatLevel,
boolean namespaceAttr,
java.lang.String namespacePrefix,
int characterType,
boolean selectionOnly)
|
static java.lang.String |
getFormattedMathML(webeq3.app.Equation eq,
int markupType,
int formatLevel,
boolean namespaceAttr,
java.lang.String namespacePrefix,
int characterType,
int escapePref,
boolean selectionOnly,
boolean outputCursor,
boolean filterChars)
Returns the MathML for the specified equation with the specified format. |
static java.lang.String |
getMathML(webeq3.app.Equation eq)
Returns the formatted presentation MathML markup for the specified equation. |
static java.lang.String |
getPackedContentMathML(webeq3.app.Equation eq)
Returns the unformatted content MathML markup for the specified equation. |
static java.lang.String |
getPackedMathML(webeq3.app.Equation eq)
Returns the unformatted MathML markup for the specified equation. |
static java.lang.String |
getURLDecodedString(java.lang.String mml)
In complicated web apps, such as Blackboard deploys, the double escaping problem is severe. |
static java.lang.String |
getURLDecodedString(java.lang.String mml,
int chopOff)
Returns the URL-decoded version of the string passed in, with the specified number of characters chopped off at the end. |
static java.lang.String |
getURLEncodedContentMathML(webeq3.app.Equation eq)
Returns the URL-encoded packed content MathML markup for the specified equation. |
static java.lang.String |
getURLEncodedMathML(webeq3.app.Equation eq)
Returns the URL-encoded packed MathML markup for the specified equation in which necessary characters have been escaped in order for the string to be safely transmitted as CGI data. |
static boolean |
isEquationEmpty(webeq3.app.Equation eq)
Returns true if the specified equation meets any of the following conditions: 1. |
static boolean |
isEquationSelectable(webeq3.app.Equation eq)
Returns true if the specified equation is selectable. |
static boolean |
stringEqualsChar(java.lang.String s,
char c)
|
static java.lang.String |
unescapeMathML(java.lang.String escapedMML)
Returns an unescaped version of the specified MathML. |
static java.lang.String |
unescapeSpecialChars(java.lang.String mml)
Returns the modified MathML which unescapes some special characters, such as <, >, ', and &. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CONTENT
public static final int ENTITY_NAMES
public static final int ENTITY_OR_NUMERICAL
public static final int ESCAPE_ALL
public static final int ESCAPE_NONE
public static final int ESCAPE_SPECIAL
public static final int MIXED_MARKUP
public static final int NORMALIZED_PRESENTATION
public static final int NUMERICAL_REFERENCES
public static final int PACKED
public static final int PACKED_AND_ESCAPED
public static final int PACKED_AND_WRAPPED
public static final int PASS_THROUGH
public static final int PRESENTATION
public static final int PRETTY_PRINT
public static final int REGULAR_PRESENTATION
public static final int UNICODE
| Constructor Detail |
|---|
public EquationUtilities()
| Method Detail |
|---|
public static java.lang.String getContentMathML(webeq3.app.Equation eq)
eq - the equation
public static java.lang.String getDoubleEscapedContentMathML(webeq3.app.Equation eq)
eq - the equation
getDoubleEscapedMathML(Equation)public static java.lang.String getDoubleEscapedMathML(webeq3.app.Equation eq)
EntityName + ";".
eq - the equation
public static java.lang.String getFormattedMathML(webeq3.app.Equation eq,
int markupType,
int formatLevel,
boolean namespaceAttr,
java.lang.String namespacePrefix,
int characterType,
boolean selectionOnly)
public static java.lang.String getFormattedMathML(webeq3.app.Equation eq,
int markupType,
int formatLevel,
boolean namespaceAttr,
java.lang.String namespacePrefix,
int characterType,
int escapePref,
boolean selectionOnly,
boolean outputCursor,
boolean filterChars)
eq - the equationmarkupType - an integer value indicating the type of markup. The valid values are:
0 mixed content/presentation markup
1 presentation markup format
2 content markup format (if possible)
3 normalized presentation format (extra mrows removed)formatLevel - an integer value indicating the format level. The valid values are:
0 pretty printed (on multiple lines and indented to make reading easier)
1 packed (all on one line, no indenting or extra spaces)
2 packed and escaped (all on one line, all <>& shown as escaped characters)
3 packed and wrapped (no extra white space, but returns added at nearest tag at 80 columns)namespaceAttr - a boolean value indicating whether or not a namespace prefix should be added to each tag.namespacePrefix - the namespace prefix prepending each tag, if namespaceAttr is true.characterType - an integer value indicating the character type. The valid values are:
0 Special characters are shown as entity names if possible.
1 Special characters are shown in the format XXXX; where X is a hexadecimal value.
2 Special characters are shown in UTF-8 format. This is the binary representation of the characters and may look strange in many text-processing programs.escapePref - an integer value indicating how to escape entity names. The valid values are:
0 Do not escape entity names
1 Escape special entity names, such as '&', '<' and '>'
2 Escape all entity namesselectionOnly - an boolean value indicating whether we only generate MathML for the selected portion of the equationoutputCursor - an boolean value indicating whether we need to output cursor location and selection rangefilterChars - an boolean value indicating whether we need to filter certain characters
public static java.lang.String getMathML(webeq3.app.Equation eq)
eq - the equation
public static java.lang.String getPackedContentMathML(webeq3.app.Equation eq)
eq - the equation
public static java.lang.String getPackedMathML(webeq3.app.Equation eq)
eq - the equation
public static java.lang.String getURLDecodedString(java.lang.String mml)
mml - the URL-encoded string
public static java.lang.String getURLDecodedString(java.lang.String mml,
int chopOff)
mml - the URL-encoded stringchopOff - number of characters to chop off at the end
public static java.lang.String getURLEncodedContentMathML(webeq3.app.Equation eq)
eq - the equation
getURLEncodedMathML(Equation)public static java.lang.String getURLEncodedMathML(webeq3.app.Equation eq)
" " -> %20 "+" -> %2B "&" -> %26 "<" -> %3C "=" -> %3D ">" -> %3E "?" -> %3F
eq - the equation
public static boolean isEquationEmpty(webeq3.app.Equation eq)
eq - the equation
public static boolean isEquationSelectable(webeq3.app.Equation eq)
eq - the equation
public static boolean stringEqualsChar(java.lang.String s,
char c)
public static java.lang.String unescapeMathML(java.lang.String escapedMML)
public static java.lang.String unescapeSpecialChars(java.lang.String mml)
mml - the original MathML string
|
Copyright (c) 2015 Design Science All rights reserved |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||