Class Codec
java.lang.Object
org.episteme.core.mathematics.loaders.openmath.codec.Codec
A String based codec that translates (XML-encoded) OpenMath objects to
their backengine equivalent.
- Version:
- $Revision: 1.2 $
- Author:
- Manfred N. Riem (mriem@manorrock.org)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a CD to the Codec.abstract StringDecodes the backengine syntax to an OpenMath object in XML encoding.abstract OMObjectdecodeOMObject(String syntax) Decodes the backengine-syntax to an OM-object.abstract StringEncodes the XML-encoded OM-object.abstract StringencodeOMObject(OMObject object) Encodes the OM-object to backengine-syntax.voidRemoves a CD from the Codec.
-
Field Details
-
mCDs
-
-
Constructor Details
-
Codec
public Codec()Constructor.
-
-
Method Details
-
addCD
Adds a CD to the Codec.- Parameters:
name- the name of the CD.location- the URL of the CD, if none is given it is assume to be on the classpathclassName- the Codec of the CD.- Throws:
CodecException- when adding the CD (Codec) failed.
-
removeCD
Removes a CD from the Codec.- Parameters:
name- the name of the CD.- Throws:
CodecException- when removing the CD (Codec) failed.
-
encode
Encodes the XML-encoded OM-object.- Parameters:
object- the OpenMath object in XML encoding to encode.- Returns:
- the encoding for the command.
- Throws:
CodecEncodeException- when a problem arises during encoding.
-
encodeOMObject
Encodes the OM-object to backengine-syntax.- Parameters:
object- the OpenMath object to encode.- Returns:
- the encoding for the OpenMath object.
- Throws:
CodecEncodeException- when a problem arises during encoding.
-
decode
Decodes the backengine syntax to an OpenMath object in XML encoding.- Parameters:
syntax- the syntax to decode to an OpenMath object in XML encoding.- Returns:
- the OpenMath object in XML encoding.
- Throws:
CodecDecodeException- when a problem arises during decoding.
-
decodeOMObject
Decodes the backengine-syntax to an OM-object.- Parameters:
syntax- the syntax to decode to an OpenMath object.- Returns:
- the OpenMath object.
- Throws:
CodecDecodeException- when a problem arises during decoding.
-