org.mindswap.ocl.impl
Class OCLModelImpl

java.lang.Object
  extended byOntModelImpl
      extended byorg.mindswap.ocl.impl.OCLModelImpl
All Implemented Interfaces:
OCLModel

public class OCLModelImpl
extends OntModelImpl
implements OCLModel

Title: OCLModelImpl

Description: Implementation of the OCLModel interface

Copyright: Copyright (c) 2005

Company: Mindswap (http://www.mindswap.org)

See Also:
Serialized Form

Field Summary
static java.lang.String BOOLEAN
           
static java.lang.String BYTE
           
static java.lang.String CHAR
           
static java.lang.String DOUBLE
           
static java.lang.String FLOAT
           
static java.lang.String INT
           
static java.lang.String LONG
           
static java.lang.String[] PRIMITIVES
           
static java.lang.String SHORT
           
static java.lang.String STRING
           
 
Constructor Summary
OCLModelImpl()
           
 
Method Summary
 OCLConstructor createConstructor()
          Creates a new OCL constructor
 OCLConstructor createDefaultConstructor()
          Creates a new OCL default (no parameters) constructor
 OCLMethod createMethod(java.lang.String theURI)
          Creates a new OCL Method with the given URI, or as a bnode if the URI is null
 OCLMethodChain createMethodChain(java.lang.String theURI)
          Creates a new OCL MethodChain with the given URI, or as a bnode if the URI is null
 OCLObject createObject(java.lang.String theURI)
          Creates a new OCL Object with the given URI, or as a bnode if the URI is null
 OCLParameter createParameter()
          Create a new OCL Parameter
 OCLParameter createParameter(java.lang.Class theHasClass, java.lang.String theValue)
          Create a new OCL parameter with the specified type and value
static java.lang.Object createPrimitive(java.lang.String hasClass, java.lang.String theValue)
          Create a primitive of the given type with the specified value
 OCLStaticMethod createStaticMethod(java.lang.String theURI)
          Creates a new OCL StaticMethod with the given URI, or as a bnode if the URI is null
 OCLCache getCache()
          Returns the current cache for this model
static java.lang.Class getClassForPrimitive(java.lang.String hasClass)
          Given the class name for a primitive, return the java Class object that corresponds to it
 java.lang.Object getRegisteredValue(java.lang.String theURL)
          Gets a registered object from the model given its url ID.
 boolean hasRegisteredValue(java.lang.String theURL)
          Checks whether or not an object with the specified URL is registered with the model
static boolean isPrimitiveType(java.lang.String typeString)
          Returns whether or not the given type string represents a java primitive
 ResIterator listOCLMethodChains()
          Lists all OCLMethodChains in the model
 ResIterator listOCLMethods()
          Lists all OCLMethods in the model
 ResIterator listOCLObjects()
          Lists all OCLObjects currently in the model
 ResIterator listOCLStaticMethods()
          Lists all OCLStaticMethods in the model
 void register(java.lang.String theURL, java.lang.Object theObject)
          Registers an outside object with the model.
 void setCache(OCLCache theCache)
          Sets the cache to be used by this model.
 void setRegistry(OCLRegistry theRegistry)
          Sets the OCL registry for this model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INT

public static final java.lang.String INT
See Also:
Constant Field Values

FLOAT

public static final java.lang.String FLOAT
See Also:
Constant Field Values

CHAR

public static final java.lang.String CHAR
See Also:
Constant Field Values

LONG

public static final java.lang.String LONG
See Also:
Constant Field Values

BYTE

public static final java.lang.String BYTE
See Also:
Constant Field Values

DOUBLE

public static final java.lang.String DOUBLE
See Also:
Constant Field Values

SHORT

public static final java.lang.String SHORT
See Also:
Constant Field Values

BOOLEAN

public static final java.lang.String BOOLEAN
See Also:
Constant Field Values

STRING

public static final java.lang.String STRING
See Also:
Constant Field Values

PRIMITIVES

public static final java.lang.String[] PRIMITIVES
Constructor Detail

OCLModelImpl

public OCLModelImpl()
Method Detail

listOCLObjects

public ResIterator listOCLObjects()
Description copied from interface: OCLModel
Lists all OCLObjects currently in the model

Specified by:
listOCLObjects in interface OCLModel
Returns:
ResIterator an iterator over the list of OCLObjects in the model

listOCLMethods

public ResIterator listOCLMethods()
Description copied from interface: OCLModel
Lists all OCLMethods in the model

Specified by:
listOCLMethods in interface OCLModel
Returns:
ResIterator an iterator over the list of OCLMethods in the model

listOCLStaticMethods

public ResIterator listOCLStaticMethods()
Description copied from interface: OCLModel
Lists all OCLStaticMethods in the model

Specified by:
listOCLStaticMethods in interface OCLModel
Returns:
ResIterator an iterator over the list of OCLStaticMethods in the model

listOCLMethodChains

public ResIterator listOCLMethodChains()
Description copied from interface: OCLModel
Lists all OCLMethodChains in the model

Specified by:
listOCLMethodChains in interface OCLModel
Returns:
ResIterator an iterator over the list of OCLMethodChains in the model

register

public void register(java.lang.String theURL,
                     java.lang.Object theObject)
Description copied from interface: OCLModel
Registers an outside object with the model. Registering an object allows it to be used by OCL objects during their construction and invocation.

Specified by:
register in interface OCLModel
Parameters:
theURL - String the url ID of the object
theObject - Object the object to register

hasRegisteredValue

public boolean hasRegisteredValue(java.lang.String theURL)
Description copied from interface: OCLModel
Checks whether or not an object with the specified URL is registered with the model

Specified by:
hasRegisteredValue in interface OCLModel
Parameters:
theURL - String the url to check
Returns:
boolean true if an object with the url is registered, false otherwise

getRegisteredValue

public java.lang.Object getRegisteredValue(java.lang.String theURL)
Description copied from interface: OCLModel
Gets a registered object from the model given its url ID.

Specified by:
getRegisteredValue in interface OCLModel
Parameters:
theURL - String the URL of the object to get
Returns:
Object the object with the corresponding url ID, or null if none exists

setRegistry

public void setRegistry(OCLRegistry theRegistry)
Description copied from interface: OCLModel
Sets the OCL registry for this model

Specified by:
setRegistry in interface OCLModel
Parameters:
theRegistry - OCLRegistry the new OCL registry

getClassForPrimitive

public static java.lang.Class getClassForPrimitive(java.lang.String hasClass)
Given the class name for a primitive, return the java Class object that corresponds to it

Parameters:
hasClass - String the class name
Returns:
Class the class that corresponds to the specified class name, or null if one doesnt exist

createPrimitive

public static java.lang.Object createPrimitive(java.lang.String hasClass,
                                               java.lang.String theValue)
Create a primitive of the given type with the specified value

Parameters:
hasClass - String the primitive class to create
theValue - String the value for the new primitive
Returns:
Object the primitive created, or null if the class or value is invalid

isPrimitiveType

public static boolean isPrimitiveType(java.lang.String typeString)
Returns whether or not the given type string represents a java primitive

Parameters:
typeString - String the type
Returns:
boolean true if it is a primitive type, false otherwise

setCache

public void setCache(OCLCache theCache)
Description copied from interface: OCLModel
Sets the cache to be used by this model. The cache is used to keep records of Jar files that have been downloaded already so that they do not have to be re-downloaded every time something is executed

Specified by:
setCache in interface OCLModel
Parameters:
theCache - OCLCache the new cache to use

getCache

public OCLCache getCache()
Description copied from interface: OCLModel
Returns the current cache for this model

Specified by:
getCache in interface OCLModel
Returns:
OCLCache the current cache

createObject

public OCLObject createObject(java.lang.String theURI)
Description copied from interface: OCLModel
Creates a new OCL Object with the given URI, or as a bnode if the URI is null

Specified by:
createObject in interface OCLModel
Parameters:
theURI - String the uri of the new object, or null to create a bnode
Returns:
OCLObject

createMethod

public OCLMethod createMethod(java.lang.String theURI)
Description copied from interface: OCLModel
Creates a new OCL Method with the given URI, or as a bnode if the URI is null

Specified by:
createMethod in interface OCLModel
Parameters:
theURI - String the uri of the new method, or null to create a bnode
Returns:
OCLMethod

createStaticMethod

public OCLStaticMethod createStaticMethod(java.lang.String theURI)
Description copied from interface: OCLModel
Creates a new OCL StaticMethod with the given URI, or as a bnode if the URI is null

Specified by:
createStaticMethod in interface OCLModel
Parameters:
theURI - String the uri of the new method, or null to create a bnode
Returns:
OCLStaticMethod

createMethodChain

public OCLMethodChain createMethodChain(java.lang.String theURI)
Description copied from interface: OCLModel
Creates a new OCL MethodChain with the given URI, or as a bnode if the URI is null

Specified by:
createMethodChain in interface OCLModel
Parameters:
theURI - String the uri of the new method chain, or null to create a bnode
Returns:
OCLMethodChain

createDefaultConstructor

public OCLConstructor createDefaultConstructor()
Description copied from interface: OCLModel
Creates a new OCL default (no parameters) constructor

Specified by:
createDefaultConstructor in interface OCLModel
Returns:
OCLConstructor

createConstructor

public OCLConstructor createConstructor()
Description copied from interface: OCLModel
Creates a new OCL constructor

Specified by:
createConstructor in interface OCLModel
Returns:
OCLConstructor

createParameter

public OCLParameter createParameter()
Description copied from interface: OCLModel
Create a new OCL Parameter

Specified by:
createParameter in interface OCLModel
Returns:
OCLParameter

createParameter

public OCLParameter createParameter(java.lang.Class theHasClass,
                                    java.lang.String theValue)
Description copied from interface: OCLModel
Create a new OCL parameter with the specified type and value

Specified by:
createParameter in interface OCLModel
Parameters:
theHasClass - Class the parameter class type
theValue - String the parameter value
Returns:
OCLParameter