it.unimo.dbgroup.momis.odli3
Class Attribute

java.lang.Object
  extended byit.unimo.dbgroup.momis.odli3.MomisObject
      extended byit.unimo.dbgroup.momis.odli3.Attribute
All Implemented Interfaces:
AttributeInterface, OntologyAnnotableElement, java.io.Serializable
Direct Known Subclasses:
Relationship, SimpleAttribute

public abstract class Attribute
extends MomisObject
implements java.io.Serializable, AttributeInterface, OntologyAnnotableElement

Descrive un'attributo locale o globale, semplice o complesso.

See Also:
Serialized Form

Field Summary
private  IntBody _belongsTo
          oggetto IntBody: rappresenta l'interface body a cui l'attributo appartiene
private  boolean _isOptional
          True if an attribute is optional.
private  java.lang.String _name
          Attribute name
private  OntologyAnnotation _ontologyAnnotation
          contain a reference to the OntologyAnnotation Object.
static java.util.Comparator COMPARE_ON_DOTTED_NAME
          Comparator used to Sort arrays.
static java.util.Comparator COMPARE_ON_NAME
          Comparator used to Sort arrays.
 
Fields inherited from class it.unimo.dbgroup.momis.odli3.MomisObject
mod_GenericODLParser, mod_GlobalSchema, mod_QueryManger, mod_SIDes_ARM, mod_SIDes_ARTEMIS, mod_SIDes_EXTM, mod_SIDes_JoinMap, mod_SIDes_main, mod_SIDes_SAM, mod_SIDes_SIM, mod_SIDes_SIM2, mod_SIDes_SLIM, mod_SIDes_TREdit, mod_SIDes_TUNIM
 
Constructor Summary
Attribute()
          Constructor.
 
Method Summary
 void control()
          Controlla a posteriori la coerenza del contenuto degli attributi
 java.lang.String getDottedName()
          Return the dotted name of this Attribute:
 IntBody getIntBody()
           
 Interface getInterface()
          Returns the interface this Attribute belongs to.
static java.util.Vector getMatchingAttribute(java.util.Vector vatt1, java.util.Vector vatt2)
          Attribute type matching algorithm.
 java.lang.String getName()
          Get the name of the attribute.
 OntologyAnnotation getOntologyAnnotation()
          Retrieve the "annotation" for this element
 boolean getOptionality()
          Returns true if the attribute is optional attribute (es: name?).
 Schema getSchema()
          Returns the interface this Attribute belongs to.
 Type getType()
          Get the type for this attribute.
private  void initVars()
           
 void setIntBody(IntBody belongsToIntBody)
           
 void setName(java.lang.String v)
          sets the name of the attribute.
 void setOntologyAnnotation(OntologyAnnotation ontologyAnnotation)
          sets the "annotation" for this element
 void setOptionality(boolean isOptional)
          Sets the optionality attribute.
 java.lang.String toOdl()
          Returns the Odl description.
 java.lang.String toOlcdAttributes(TranslationMap tm, TranslationMap tmName)
          Returns the OLCD description.
 
Methods inherited from class it.unimo.dbgroup.momis.odli3.MomisObject
getAdditionalInfo, getAdditionalInfos, getGenericProducerDescription, getProducerDescription, getProducerId, putAdditionalInfo, setProducerId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPARE_ON_NAME

public static final java.util.Comparator COMPARE_ON_NAME
Comparator used to Sort arrays.


COMPARE_ON_DOTTED_NAME

public static final java.util.Comparator COMPARE_ON_DOTTED_NAME
Comparator used to Sort arrays.


_name

private java.lang.String _name
Attribute name


_belongsTo

private IntBody _belongsTo
oggetto IntBody: rappresenta l'interface body a cui l'attributo appartiene


_isOptional

private boolean _isOptional
True if an attribute is optional.


_ontologyAnnotation

private OntologyAnnotation _ontologyAnnotation
contain a reference to the OntologyAnnotation Object.

Constructor Detail

Attribute

public Attribute()
Constructor.

Method Detail

initVars

private void initVars()

getName

public java.lang.String getName()
Get the name of the attribute.

Specified by:
getName in interface AttributeInterface

setName

public void setName(java.lang.String v)
sets the name of the attribute.

Specified by:
setName in interface AttributeInterface

getDottedName

public java.lang.String getDottedName()
Return the dotted name of this Attribute:
SourceName.ClassName.AttributeName

Specified by:
getDottedName in interface AttributeInterface

getInterface

public Interface getInterface()
Returns the interface this Attribute belongs to.

Specified by:
getInterface in interface AttributeInterface

getSchema

public Schema getSchema()
Returns the interface this Attribute belongs to.


toOdl

public java.lang.String toOdl()
Returns the Odl description.

Specified by:
toOdl in interface AttributeInterface

getOptionality

public boolean getOptionality()
Returns true if the attribute is optional attribute (es: name?).

Specified by:
getOptionality in interface AttributeInterface

setOptionality

public void setOptionality(boolean isOptional)
Sets the optionality attribute.

Specified by:
setOptionality in interface AttributeInterface

toOlcdAttributes

public java.lang.String toOlcdAttributes(TranslationMap tm,
                                         TranslationMap tmName)
Returns the OLCD description.

Specified by:
toOlcdAttributes in interface AttributeInterface

getMatchingAttribute

public static java.util.Vector getMatchingAttribute(java.util.Vector vatt1,
                                                    java.util.Vector vatt2)
Attribute type matching algorithm.
 NOT YET IMPLEMENTED
 We have to implement a full type-matching in ODL-I3 classes.
 
Verifica che tra i due vettori di attributi vi sia corrispondenza di tipo per almeno uno degli attributi.

Parameters:
vatt1 - Vector of attributes for the first Interface.
vatt2 - Vector of attributes for the second Interface.

control

public void control()
             throws OdlException
Controlla a posteriori la coerenza del contenuto degli attributi

E' un metodo vuoto perche' ogni sottoclasse lo implementa in modo diverso.

Specified by:
control in interface AttributeInterface
Throws:
OdlException

getType

public Type getType()
Get the type for this attribute.

Each descendant class should implement this method.

Specified by:
getType in interface AttributeInterface

getIntBody

public IntBody getIntBody()
Specified by:
getIntBody in interface AttributeInterface

setIntBody

public void setIntBody(IntBody belongsToIntBody)
Specified by:
setIntBody in interface AttributeInterface

getOntologyAnnotation

public OntologyAnnotation getOntologyAnnotation()
Retrieve the "annotation" for this element

Specified by:
getOntologyAnnotation in interface OntologyAnnotableElement

setOntologyAnnotation

public void setOntologyAnnotation(OntologyAnnotation ontologyAnnotation)
sets the "annotation" for this element

Specified by:
setOntologyAnnotation in interface OntologyAnnotableElement


Universita' di Modena e Reggio Emilia