Package jade.content.lang
Class StringCodec
- java.lang.Object
-
- jade.content.lang.Codec
-
- jade.content.lang.StringCodec
-
- All Implemented Interfaces:
Serializable,Serializable
- Direct Known Subclasses:
SimpleSLCodec,SLCodec
public abstract class StringCodec extends Codec
Base class for content language codecs that transform AbsContentElements to/from sequences of strings- Author:
- Giovanni Caire - TILAB
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jade.content.lang.Codec
Codec.CodecException
-
-
Field Summary
-
Fields inherited from class jade.content.lang.Codec
UNNAMEDPREFIX
-
-
Constructor Summary
Constructors Constructor Description StringCodec(String name)Construct a StringCodec object with the given name
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract AbsContentElementdecode(Ontology ontology, String content)Decodes the content to an abstract description using a given ontology.abstract AbsContentElementdecode(String content)Decodes the content to an abstract description.abstract Stringencode(AbsContentElement content)Encodes a content into a string.abstract Stringencode(Ontology ontology, AbsContentElement content)Encodes a content into a string using a given ontology.-
Methods inherited from class jade.content.lang.Codec
getInnerOntology, getName
-
-
-
-
Constructor Detail
-
StringCodec
public StringCodec(String name)
Construct a StringCodec object with the given name
-
-
Method Detail
-
encode
public abstract String encode(AbsContentElement content) throws Codec.CodecException
Encodes a content into a string.- Parameters:
content- the content as an abstract descriptor.- Returns:
- the content as a string.
- Throws:
Codec.CodecException
-
encode
public abstract String encode(Ontology ontology, AbsContentElement content) throws Codec.CodecException
Encodes a content into a string using a given ontology.- Parameters:
ontology- the ontologycontent- the content as an abstract descriptor.- Returns:
- the content as a string.
- Throws:
Codec.CodecException
-
decode
public abstract AbsContentElement decode(String content) throws Codec.CodecException
Decodes the content to an abstract description.- Parameters:
content- the content as a string.- Returns:
- the content as an abstract description.
- Throws:
Codec.CodecException
-
decode
public abstract AbsContentElement decode(Ontology ontology, String content) throws Codec.CodecException
Decodes the content to an abstract description using a given ontology.- Parameters:
ontology- the ontology.content- the content as a string.- Returns:
- the content as an abstract description.
- Throws:
Codec.CodecException
-
-