com.rapidtransform.core.meta.service
Class MetaServiceImpl

java.lang.Object
  extended by com.rapidtransform.core.meta.service.MetaServiceImpl
All Implemented Interfaces:
MetaService, org.springframework.context.ResourceLoaderAware

public class MetaServiceImpl
extends java.lang.Object
implements MetaService, org.springframework.context.ResourceLoaderAware

Author:
Steve Werner

Constructor Summary
MetaServiceImpl()
           
 
Method Summary
 void addModel(MetaModel model)
           
 Dictionary getDictionary()
           
 MetaModel getLoadedModel(Namespace namespace)
           
 MetaModel getLoadedModel(QName qName)
           
 java.util.Collection<MetaModel> getLoadedModels()
           
 java.util.List<org.springframework.core.io.Resource> getModelResources()
           
 java.util.List<java.lang.String> getModels()
           
 Namespace getNamespace(QName type)
          returns the namespace associated with the given type.
 PropertyHolder getProperties(QName type)
           
 PropertyHolder getProperties(java.lang.String typeQname)
           
 MetaProperty getProperty(java.lang.String fullyQualifiedPropertyName)
          Finds the MetaProperty for the given internal property name.
 QName getRelationTarget(QName source, QName relation)
          Checks if the specified relation is valid for the given type and returns the target type if the relation is valid.
 java.util.Collection<MetaType> getSearchableTypes()
           
 MetaType getType(QName qname)
           
 MetaType getType(java.lang.String qname)
           
 void load()
           
 MetaModel loadModel(java.io.InputStream xmlModelStream)
           
 void removeModel(QName qName)
           
 void setDictionary(Dictionary dictionary)
           
 void setModelResources(java.util.List<org.springframework.core.io.Resource> modelResources)
           
 void setModels(java.util.List<java.lang.String> models)
           
 void setResourceLoader(org.springframework.core.io.ResourceLoader loader)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaServiceImpl

public MetaServiceImpl()
Method Detail

getModels

public java.util.List<java.lang.String> getModels()
Returns:
Returns the models.

setModels

public void setModels(java.util.List<java.lang.String> models)
Parameters:
models - The models to set.

getDictionary

public Dictionary getDictionary()
Returns:
Returns the dictionary.

setDictionary

public void setDictionary(Dictionary dictionary)
Parameters:
dictionary - The dictionary to set.

getModelResources

public java.util.List<org.springframework.core.io.Resource> getModelResources()
Returns:
Returns the modelResources.

setModelResources

public void setModelResources(java.util.List<org.springframework.core.io.Resource> modelResources)
Parameters:
modelResources - The modelResources to set.

load

public void load()
          throws MetaException
Specified by:
load in interface MetaService
Throws:
MetaException

loadModel

public MetaModel loadModel(java.io.InputStream xmlModelStream)
                    throws MetaException
Specified by:
loadModel in interface MetaService
Throws:
MetaException

addModel

public void addModel(MetaModel model)
Specified by:
addModel in interface MetaService

removeModel

public void removeModel(QName qName)
Specified by:
removeModel in interface MetaService

getLoadedModel

public MetaModel getLoadedModel(QName qName)
Specified by:
getLoadedModel in interface MetaService

getLoadedModel

public MetaModel getLoadedModel(Namespace namespace)
                         throws MetaException
Specified by:
getLoadedModel in interface MetaService
Throws:
MetaException

getType

public MetaType getType(QName qname)
                 throws MetaException
Specified by:
getType in interface MetaService
Throws:
MetaException

getProperties

public PropertyHolder getProperties(QName type)
                             throws MetaException
Specified by:
getProperties in interface MetaService
Throws:
MetaException

getType

public MetaType getType(java.lang.String qname)
                 throws MetaException
Specified by:
getType in interface MetaService
Throws:
MetaException

getProperties

public PropertyHolder getProperties(java.lang.String typeQname)
                             throws MetaException
Specified by:
getProperties in interface MetaService
Throws:
MetaException

getProperty

public MetaProperty getProperty(java.lang.String fullyQualifiedPropertyName)
                         throws MetaException
Finds the MetaProperty for the given internal property name.

Specified by:
getProperty in interface MetaService
Throws:
MetaException
See Also:
DictionaryImpl.getProperty(java.lang.String)

getRelationTarget

public QName getRelationTarget(QName source,
                               QName relation)
                        throws InvalidMetaRelationException,
                               MetaException
Description copied from interface: MetaService
Checks if the specified relation is valid for the given type and returns the target type if the relation is valid. If it is an invalid relation, then an exception is thrown.

Specified by:
getRelationTarget in interface MetaService
Parameters:
source - QName for the source for the relation
relation - QName for the relation
Returns:
The QName representing the type of the target
Throws:
InvalidMetaRelationException
MetaException

getNamespace

public Namespace getNamespace(QName type)
returns the namespace associated with the given type. This is how types are mapped to M1 objects - for each namespace, there is one and only one M1 object type.

Specified by:
getNamespace in interface MetaService

getLoadedModels

public java.util.Collection<MetaModel> getLoadedModels()
Specified by:
getLoadedModels in interface MetaService

getSearchableTypes

public java.util.Collection<MetaType> getSearchableTypes()
                                                  throws MetaException
Specified by:
getSearchableTypes in interface MetaService
Throws:
MetaException

setResourceLoader

public void setResourceLoader(org.springframework.core.io.ResourceLoader loader)
Specified by:
setResourceLoader in interface org.springframework.context.ResourceLoaderAware