org.infolayer.model
Class UmlClassifier

java.lang.Object
  extended byorg.infolayer.model.UmlModelElement
      extended byorg.infolayer.model.UmlClassifier
All Implemented Interfaces:
org.ksoap2.serialization.KvmSerializable, Typed
Direct Known Subclasses:
CollectionType, GenericType, MetaType, TupleType, UmlClass, UmlDataType

public class UmlClassifier
extends UmlModelElement
implements org.ksoap2.serialization.KvmSerializable, Typed

Superclass of UmlClass and UmlDataType. This class is not abstract because OclAny is implemented as direct instance of UmlClassifier.


Field Summary
static int PERMISSION_CREATE
          create permission constant, use in getPermission
static int PERMISSION_EXEC
          Execution permission, used internally in UmlOperation.getExecPermission()
static int PERMISSION_NONE
          Ignore permission, returns always true in getPermission
static int PERMISSION_QUERY
          query permission constant, use in getPermission
static int PERMISSION_READ
          Read permission constant, use in getPermission
static int PERMISSION_WRITE
          write permission constant, use in getPermission
 
Fields inherited from class org.infolayer.model.UmlModelElement
PRIVATE, PROTECTED, PUBLIC
 
Constructor Summary
UmlClassifier()
          Creates a new UmlClassifier instance.
 
Method Summary
 UmlOperation addOperation(java.lang.String name, OperationImpl impl, int modifiers, java.lang.String description)
          Creates a new UmlOperation with the given name, implementation, modifiers, sql generator and description.
 UmlOperation addOperation(UmlOperation o)
           
 UmlProperty addProperty(java.lang.String name, PropertyImpl impl, UmlClassifier type, int max, java.lang.String description)
           
 UmlProperty addProperty(UmlProperty p)
           
 OclCollection allInstances()
           
 java.util.Vector checkConstraints(java.lang.Object instance)
          Lists constratint violations for the given instance of this classifier
 OclExpression compile(java.lang.String expression)
          Shortcut for new OclParser(new VarDef(this), expression).parse()
 OclExpression compile(java.lang.String expression, java.lang.String location)
          Shortcut for new OclParser(new VarDef(this), expression).parse(), including a call to setLocation, allowing to determine the origin of the expression in the case of an error.
 java.lang.Object createInstance()
          Creates a new instance.
 boolean equals(java.lang.Object o2)
           
 UmlOperation findOperation(java.lang.String signature, boolean required)
          Searches for an operation with the given signature
 UmlProperty findProperty(java.lang.String name, boolean required)
          Searches for a property with the given name
 UmlClassifier getActualType(UmlClassifier base)
          Overwriten in GenericType
 java.util.Collection getAllSubtypes(java.util.Collection v)
          fills the given vector with all subtypes recursively.
 java.util.Vector getAllSupertypes()
          Returns a Vector containing all supertypes, including supertypes of supertypes.
 OclCollection getAttribute()
          Returns an Enumeration of al properties (attributes and association ends) of this classifier.
 UmlModelElement getBehavior()
          Returns a state machine specifying the behaviour of instances of this classifier.
 UmlClassifier getCommonSupertype(UmlClassifier c2)
          Returns the most special common supertype of this classifier and the classifier parameter
 UmlOperation getDynamicOperation(UmlOperation op)
          Returns the correct dynamic operation for this classifier and the given operation...
 java.lang.Class getInstanceJavaClass()
          Returns the java class of instances of this classifier.
 java.lang.String getLabel(java.lang.String lang)
           
 UmlModel getModel()
          Returns the UML model this classifier belongs to
 OclCollection getOperation()
          Returns all operations, including inherited operations.
 OclCollection getOwnedAttribute()
           
 OclCollection getOwnedOperation()
           
 boolean getPermission(int type, java.lang.Object instance)
          Returns the permission of the given type for the given instance
 java.lang.Object getProperty(int index)
          Returns the property with the given index
 int getPropertyCount()
           
 void getPropertyInfo(int index, java.util.Hashtable props, org.ksoap2.serialization.PropertyInfo info)
           
 UmlProperty getStateProperty()
          Returns the property that stores the StateMachine state of this object.
 java.util.Vector getSubtypes()
           
 UmlClassifier getSupertype()
           
 java.lang.String getTaggedValueRecursive(java.lang.String name)
           
 UmlClassifier getType()
          Implementation of the Typed interface, returns the "Meta-Type"
 void init()
          if not yet initialized initialize superclass, create ilProperties vector, copy super properties, add and init own properties
 OclCollection instances()
           
 boolean isAbstract()
           
 boolean isAssignableFrom(UmlClassifier c2)
          Determines if the classifier represented by this UmlClassifier object is either the same as, or is a super-classifier of, the classifier represented by the specified UmlClassifier parameter.
 UmlOperation lookUpOperation(java.lang.String name, UmlClassifier[] params)
           
 void setProperty(int index, java.lang.Object value)
           
 java.lang.String toOclLiteral()
           
 java.lang.String toOclLiteral(java.lang.Object object)
          Please note that -- in contrast to "toString", this method adds sufficient typing inforamtion to reconstruct the object with an ocl parser.
 java.lang.String toString()
           
 int typeDistance(UmlClassifier c2)
          c2 is more special (parameter order identical to isAssignableFrom)
 
Methods inherited from class org.infolayer.model.UmlModelElement
getComment, getLabel, getName, getTaggedValue, getTaggedValue, getVisibility, setName, setTaggedValue, setVisibility, setVisibility
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PERMISSION_NONE

public static final int PERMISSION_NONE
Ignore permission, returns always true in getPermission

See Also:
Constant Field Values

PERMISSION_READ

public static final int PERMISSION_READ
Read permission constant, use in getPermission

See Also:
Constant Field Values

PERMISSION_WRITE

public static final int PERMISSION_WRITE
write permission constant, use in getPermission

See Also:
Constant Field Values

PERMISSION_QUERY

public static final int PERMISSION_QUERY
query permission constant, use in getPermission

See Also:
Constant Field Values

PERMISSION_CREATE

public static final int PERMISSION_CREATE
create permission constant, use in getPermission

See Also:
Constant Field Values

PERMISSION_EXEC

public static final int PERMISSION_EXEC
Execution permission, used internally in UmlOperation.getExecPermission()

See Also:
Constant Field Values
Constructor Detail

UmlClassifier

public UmlClassifier()
Creates a new UmlClassifier instance. Used in the XMI reader

Method Detail

toOclLiteral

public java.lang.String toOclLiteral(java.lang.Object object)
Please note that -- in contrast to "toString", this method adds sufficient typing inforamtion to reconstruct the object with an ocl parser.


addProperty

public UmlProperty addProperty(UmlProperty p)

addOperation

public UmlOperation addOperation(UmlOperation o)

addOperation

public UmlOperation addOperation(java.lang.String name,
                                 OperationImpl impl,
                                 int modifiers,
                                 java.lang.String description)
Creates a new UmlOperation with the given name, implementation, modifiers, sql generator and description. If an operation with the given name and signature is already existing, both are merged. Used to create the predefined operations.


addProperty

public UmlProperty addProperty(java.lang.String name,
                               PropertyImpl impl,
                               UmlClassifier type,
                               int max,
                               java.lang.String description)

checkConstraints

public java.util.Vector checkConstraints(java.lang.Object instance)
Lists constratint violations for the given instance of this classifier


createInstance

public java.lang.Object createInstance()
Creates a new instance. This method will throw an exception. It is overwritten in UmlClass. TODO: Check where this is called, why, and how to make it consistent with datatype (from string) constructors


equals

public boolean equals(java.lang.Object o2)

instances

public OclCollection instances()

allInstances

public OclCollection allInstances()

findProperty

public UmlProperty findProperty(java.lang.String name,
                                boolean required)
Searches for a property with the given name

Parameters:
name - The name of the method to be found.
required - If true, an exception is thrown if the method is not found. Otherwise, null is returned.
Returns:

getAllSubtypes

public java.util.Collection getAllSubtypes(java.util.Collection v)
fills the given vector with all subtypes recursively. The return value is the given vector


getAllSupertypes

public java.util.Vector getAllSupertypes()
Returns a Vector containing all supertypes, including supertypes of supertypes.


getBehavior

public UmlModelElement getBehavior()
Returns a state machine specifying the behaviour of instances of this classifier.


compile

public OclExpression compile(java.lang.String expression)
Shortcut for new OclParser(new VarDef(this), expression).parse()


compile

public OclExpression compile(java.lang.String expression,
                             java.lang.String location)
Shortcut for new OclParser(new VarDef(this), expression).parse(), including a call to setLocation, allowing to determine the origin of the expression in the case of an error.


getCommonSupertype

public UmlClassifier getCommonSupertype(UmlClassifier c2)
Returns the most special common supertype of this classifier and the classifier parameter


getInstanceJavaClass

public java.lang.Class getInstanceJavaClass()
Returns the java class of instances of this classifier. Returns the value of instanceJavaClass, or, if null, the return value of the same method of the super classifier.


getModel

public UmlModel getModel()
Returns the UML model this classifier belongs to


getPermission

public boolean getPermission(int type,
                             java.lang.Object instance)
Returns the permission of the given type for the given instance


getProperty

public java.lang.Object getProperty(int index)
Returns the property with the given index

Specified by:
getProperty in interface org.ksoap2.serialization.KvmSerializable
Overrides:
getProperty in class UmlModelElement
See Also:
org.ksoap2.marshal.KvmSerializable#getProperty(int)

getPropertyCount

public int getPropertyCount()
Specified by:
getPropertyCount in interface org.ksoap2.serialization.KvmSerializable
Overrides:
getPropertyCount in class UmlModelElement
See Also:
org.ksoap2.marshal.KvmSerializable#getPropertyCount()

getPropertyInfo

public void getPropertyInfo(int index,
                            java.util.Hashtable props,
                            org.ksoap2.serialization.PropertyInfo info)
Specified by:
getPropertyInfo in interface org.ksoap2.serialization.KvmSerializable
Overrides:
getPropertyInfo in class UmlModelElement
See Also:
org.ksoap2.marshal.KvmSerializable#getPropertyInfo(int, PropertyInfo)

getStateProperty

public UmlProperty getStateProperty()
Returns the property that stores the StateMachine state of this object.


getSubtypes

public java.util.Vector getSubtypes()

getSupertype

public UmlClassifier getSupertype()

getType

public UmlClassifier getType()
Implementation of the Typed interface, returns the "Meta-Type"

Specified by:
getType in interface Typed

init

public void init()
if not yet initialized
  1. initialize superclass,
  2. create ilProperties vector,
  3. copy super properties,
  4. add and init own properties

Overrides:
init in class UmlModelElement

isAbstract

public boolean isAbstract()

isAssignableFrom

public boolean isAssignableFrom(UmlClassifier c2)

Determines if the classifier represented by this UmlClassifier object is either the same as, or is a super-classifier of, the classifier represented by the specified UmlClassifier parameter.

Specifically, this method tests whether the type represented by the specified Class parameter can be converted to the type represented by this Class object via an identity conversion or via a widening reference conversion.


getOperation

public OclCollection getOperation()
Returns all operations, including inherited operations. Please note that it may be necessary to call getDynamicOperation first in order to find the correct implementation when working with subclasses.


getOwnedOperation

public OclCollection getOwnedOperation()

getOwnedAttribute

public OclCollection getOwnedAttribute()

getDynamicOperation

public UmlOperation getDynamicOperation(UmlOperation op)
Returns the correct dynamic operation for this classifier and the given operation...


findOperation

public UmlOperation findOperation(java.lang.String signature,
                                  boolean required)
Searches for an operation with the given signature

Parameters:
signature - The signature of the method to be found.
required - If true, an exception is thrown if the method is not found. Otherwise, null is returned.
Returns:

getAttribute

public OclCollection getAttribute()
Returns an Enumeration of al properties (attributes and association ends) of this classifier. public Iterator properties() { if (propertyCache == null) initFeatureCache(UmlProperty.class); return new ArrayIterator(propertyCache); // return new PropertyIterator(this, PERMISSION_NONE, null); }


setProperty

public void setProperty(int index,
                        java.lang.Object value)
Specified by:
setProperty in interface org.ksoap2.serialization.KvmSerializable
Overrides:
setProperty in class UmlModelElement
See Also:
org.ksoap2.marshal.KvmSerializable#setProperty(int, Object)

getTaggedValueRecursive

public java.lang.String getTaggedValueRecursive(java.lang.String name)

lookUpOperation

public UmlOperation lookUpOperation(java.lang.String name,
                                    UmlClassifier[] params)

toString

public java.lang.String toString()
Overrides:
toString in class UmlModelElement

typeDistance

public int typeDistance(UmlClassifier c2)
c2 is more special (parameter order identical to isAssignableFrom)


getLabel

public java.lang.String getLabel(java.lang.String lang)

getActualType

public UmlClassifier getActualType(UmlClassifier base)
Overwriten in GenericType


toOclLiteral

public java.lang.String toOclLiteral()
Specified by:
toOclLiteral in interface Typed