public class AbsHelper extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
AbsHelper.VarIndexWrapper
Inner class used to manage variable name generation
|
Constructor and Description |
---|
AbsHelper() |
Modifier and Type | Method and Description |
---|---|
static AbsObject |
createAbsTemplate(Class clazz,
Ontology onto)
Generate an AbsObject consistently with class.
|
static AbsObject |
createAbsTemplate(ObjectSchema schema)
Generate an AbsObject consistently with schema.
|
static AbsObject |
createAbsTemplate(ObjectSchema schema,
String prefix)
Generate an AbsObject consistently with schema.
|
private static AbsObject |
createAbsTemplate(ObjectSchema schema,
String prefix,
AbsHelper.VarIndexWrapper viw) |
private static String |
createVariableName(String prefix,
AbsHelper.VarIndexWrapper viw) |
static AbsAgentAction |
externaliseACLMessage(ACLMessage obj,
Ontology onto)
Converts an
ACLMessage into an
AbsAgentAction using
the specified ontology. |
static AbsConcept |
externaliseAID(AID obj)
Converts an
AID into an AbsConcept
representing an AID |
static AbsContentElementList |
externaliseContentElementList(ContentElementList obj,
Ontology onto)
Converts a
ContentElementList into an
AbsContentElementList using
the specified ontology. |
static AbsAggregate |
externaliseIterator(Iterator obj,
Ontology onto,
String AggregateType)
Converts an
Iterator into a AbsAggregate using
the specified ontology. |
static AbsAggregate |
externaliseList(List obj,
Ontology onto,
String AggregateType)
Converts a
List into a AbsAggregate using
the specified ontology. |
static AbsAggregate |
externaliseSet(Set obj,
Ontology onto,
String AggregateType)
Converts a
Set into a AbsAggregate using
the specified ontology. |
static OntoACLMessage |
internaliseACLMessage(AbsAgentAction absMsg,
Ontology onto)
Converts to an
AbsAgentAction representing an ACLMessage
into an OntoACLMessage using the specified ontology. |
static OntoAID |
internaliseAID(AbsConcept aid)
Converts an
AbsConcept representing an AID
into an OntoAID |
static ContentElementList |
internaliseContentElementList(AbsContentElementList l,
Ontology onto)
Converts to an
AbsContentElementList into a
ContentElementList using the
specified ontology. |
static Collection |
internaliseJavaCollection(AbsAggregate aggregate,
Ontology onto)
Converts an
AbsAggregate into a List using the
specified ontology. |
static List |
internaliseList(AbsAggregate aggregate,
Ontology onto)
Converts an
AbsAggregate into a List using the
specified ontology. |
static Set |
internaliseSet(AbsAggregate aggregate,
Ontology onto)
Converts an
AbsAggregate into a Set using the
specified ontology. |
static AbsObject |
nullifyVariables(AbsObject abs,
boolean removeEmptyAggregate)
Remove all variables and empty aggregates (only if specified)
|
static void |
setAttribute(AbsObject abs,
String attrName,
AbsObject attrValue)
Set an attribute in an abstract descriptor performing all
necessary type checks.
|
public static AbsAggregate externaliseList(List obj, Ontology onto, String AggregateType) throws OntologyException
List
into a AbsAggregate
using
the specified ontology.obj
- the List
onto
- the ontology.OntologyException
public static AbsAggregate externaliseSet(Set obj, Ontology onto, String AggregateType) throws OntologyException
Set
into a AbsAggregate
using
the specified ontology.obj
- the Set
onto
- the ontology.OntologyException
public static AbsAggregate externaliseIterator(Iterator obj, Ontology onto, String AggregateType) throws OntologyException
Iterator
into a AbsAggregate
using
the specified ontology.obj
- the Iterator
onto
- the ontology.OntologyException
public static AbsConcept externaliseAID(AID obj)
AID
into an AbsConcept
representing an AIDobj
- the AID
public static AbsContentElementList externaliseContentElementList(ContentElementList obj, Ontology onto) throws OntologyException
ContentElementList
into an
AbsContentElementList
using
the specified ontology.obj
- the ContentElementList
onto
- the ontology.OntologyException
public static AbsAgentAction externaliseACLMessage(ACLMessage obj, Ontology onto) throws OntologyException
ACLMessage
into an
AbsAgentAction
using
the specified ontology.obj
- the ACLMessage
onto
- the ontology.OntologyException
public static List internaliseList(AbsAggregate aggregate, Ontology onto) throws OntologyException
AbsAggregate
into a List using the
specified ontology.onto
- the ontologyOntologyException
public static Set internaliseSet(AbsAggregate aggregate, Ontology onto) throws OntologyException
AbsAggregate
into a Set using the
specified ontology.onto
- the ontologyOntologyException
public static Collection internaliseJavaCollection(AbsAggregate aggregate, Ontology onto) throws OntologyException
AbsAggregate
into a List using the
specified ontology.onto
- the ontologyOntologyException
public static OntoAID internaliseAID(AbsConcept aid) throws OntologyException
AbsConcept
representing an AID
into an OntoAIDOntologyException
- if aid
does not
represent a valid AIDpublic static ContentElementList internaliseContentElementList(AbsContentElementList l, Ontology onto) throws OntologyException
AbsContentElementList
into a
ContentElementList using the
specified ontology.onto
- the ontologyOntologyException
public static OntoACLMessage internaliseACLMessage(AbsAgentAction absMsg, Ontology onto) throws OntologyException
AbsAgentAction
representing an ACLMessage
into an OntoACLMessage using the specified ontology.onto
- the ontologyOntologyException
public static void setAttribute(AbsObject abs, String attrName, AbsObject attrValue) throws OntologyException
OntologyException
- if a type mismatch is detectedpublic static AbsObject nullifyVariables(AbsObject abs, boolean removeEmptyAggregate)
abs
- to nullifyremoveEmptyAggregate
- if true remove all empty aggregatespublic static AbsObject createAbsTemplate(Class clazz, Ontology onto) throws OntologyException
clazz
- class to convertonto
- reference ontologyOntologyException
public static AbsObject createAbsTemplate(ObjectSchema schema) throws OntologyException
schema
- to convertException
OntologyException
public static AbsObject createAbsTemplate(ObjectSchema schema, String prefix) throws OntologyException
schema
- to convertprefix
- for variableException
OntologyException
private static AbsObject createAbsTemplate(ObjectSchema schema, String prefix, AbsHelper.VarIndexWrapper viw) throws OntologyException
OntologyException
private static String createVariableName(String prefix, AbsHelper.VarIndexWrapper viw)