class SimpleSLCodec extends StringCodec
Codec.CodecException
Modifier and Type | Field and Description |
---|---|
private int |
indent |
private Logger |
logger |
UNNAMEDPREFIX
Constructor and Description |
---|
SimpleSLCodec() |
Modifier and Type | Method and Description |
---|---|
AbsContentElement |
decode(Ontology ontology,
String content)
Decodes the content to an abstract description using a
given ontology.
|
AbsContentElement |
decode(String content)
Decodes the content to an abstract description.
|
String |
encode(AbsContentElement content)
Encodes a content into a string.
|
String |
encode(Ontology ontology,
AbsContentElement content)
Encodes a content into a string using a given ontology.
|
private void |
encodeSlotsByName(AbsObject val,
String[] slotNames,
Ontology onto,
StringBuffer str)
Encode the slots of an abstract descriptor by name, i.e.
|
private void |
encodeSlotsByOrder(AbsObject val,
String[] slotNames,
Ontology onto,
StringBuffer str)
Encode the slots of an abstract descriptor by order, i.e.
|
private void |
fillAggregate(AbsAggregate abs,
SimpleSLTokenizer p,
Ontology o) |
private void |
fillSlotsByName(AbsConcept abs,
SimpleSLTokenizer p,
Ontology o) |
private void |
fillSlotsByOrder(AbsObject abs,
ObjectSchema s,
SimpleSLTokenizer p,
Ontology o) |
Ontology |
getInnerOntology() |
private AbsObject |
parse(SimpleSLTokenizer p,
Ontology o) |
private AbsObject |
parseComplex(SimpleSLTokenizer p,
Ontology o) |
private AbsObject |
parseSimple(SimpleSLTokenizer p) |
private void |
stringify(AbsObject val,
Ontology onto,
StringBuffer str) |
private void |
stringifyAggregate(AbsAggregate val,
Ontology onto,
StringBuffer str) |
private void |
stringifyComplex(AbsObject val,
Ontology onto,
StringBuffer str) |
private void |
stringifyPrimitive(AbsPrimitive val,
StringBuffer str) |
private void |
stringifyVariable(AbsVariable val,
StringBuffer str) |
private int indent
private Logger logger
public String encode(Ontology ontology, AbsContentElement content) throws Codec.CodecException
encode
in class StringCodec
ontology
- the ontologycontent
- the content as an abstract descriptor.CodecException
Codec.CodecException
private void stringify(AbsObject val, Ontology onto, StringBuffer str) throws Codec.CodecException
Codec.CodecException
private void stringifyComplex(AbsObject val, Ontology onto, StringBuffer str) throws Codec.CodecException
Codec.CodecException
private void encodeSlotsByOrder(AbsObject val, String[] slotNames, Ontology onto, StringBuffer str) throws Codec.CodecException
Codec.CodecException
private void encodeSlotsByName(AbsObject val, String[] slotNames, Ontology onto, StringBuffer str) throws Codec.CodecException
Codec.CodecException
private void stringifyAggregate(AbsAggregate val, Ontology onto, StringBuffer str) throws Codec.CodecException
Codec.CodecException
private void stringifyVariable(AbsVariable val, StringBuffer str) throws Codec.CodecException
Codec.CodecException
private void stringifyPrimitive(AbsPrimitive val, StringBuffer str) throws Codec.CodecException
Codec.CodecException
public AbsContentElement decode(Ontology ontology, String content) throws Codec.CodecException
decode
in class StringCodec
ontology
- the ontology.content
- the content as a string.CodecException
Codec.CodecException
private AbsObject parse(SimpleSLTokenizer p, Ontology o) throws Codec.CodecException
Codec.CodecException
private AbsObject parseComplex(SimpleSLTokenizer p, Ontology o) throws Codec.CodecException
Codec.CodecException
private void fillSlotsByOrder(AbsObject abs, ObjectSchema s, SimpleSLTokenizer p, Ontology o) throws Codec.CodecException
Codec.CodecException
private void fillSlotsByName(AbsConcept abs, SimpleSLTokenizer p, Ontology o) throws Codec.CodecException
Codec.CodecException
private void fillAggregate(AbsAggregate abs, SimpleSLTokenizer p, Ontology o) throws Codec.CodecException
Codec.CodecException
private AbsObject parseSimple(SimpleSLTokenizer p) throws Codec.CodecException
Codec.CodecException
public AbsContentElement decode(String content) throws Codec.CodecException
StringCodec
decode
in class StringCodec
content
- the content as a string.Codec.CodecException
public String encode(AbsContentElement content) throws Codec.CodecException
StringCodec
encode
in class StringCodec
content
- the content as an abstract descriptor.Codec.CodecException
public Ontology getInnerOntology()
getInnerOntology
in class Codec