org.compass.core.mapping.osem
Class ClassMapping

java.lang.Object
  extended by org.compass.core.mapping.AbstractMapping
      extended by org.compass.core.mapping.AbstractMultipleMapping
          extended by org.compass.core.mapping.AbstractResourceMapping
              extended by org.compass.core.mapping.osem.ClassMapping
All Implemented Interfaces:
AliasMapping, InternalResourceMapping, Mapping, MultipleMapping, PostProcessingMapping, ResourceMapping

public class ClassMapping
extends AbstractResourceMapping
implements ResourceMapping, PostProcessingMapping

Author:
kimchy

Nested Class Summary
 class ClassMapping.PostProcessMappingCallback
           
 
Field Summary
 
Fields inherited from class org.compass.core.mapping.AbstractMultipleMapping
mappings, mappingsByNameMap
 
Constructor Summary
ClassMapping()
           
 
Method Summary
 Mapping copy()
          Copies over the mapping definition into a newly instanciated Mapping object.
protected  void doPostProcess()
          Post process by using the dynamic find operations to cache them.
 List<ClassIdPropertyMapping> findClassPropertyIdMappings()
          Dynamically finds all the ClassIdPropertyMappings for the class.
 List<Mapping> findIdMappings()
          Dynamically find the id mappings.
 ClassIdPropertyMapping[] getClassIdPropertyMappings()
           
 PropertyPath getClassPath()
           
 ClassPropertyMapping[] getClassPropertyMappings()
           
 Class getClazz()
           
 Constructor getConstructor()
           
 ClassPropertyMapping.ManagedId getManagedId()
           
 Class getPolyClass()
          In case poly is set to true, this will be the class that will be instanciated for all persisted classes.
 Constructor getPolyConstructor()
           
 ResourcePropertyMapping getResourcePropertyMappingByDotPath(String path)
          Returns the ResourcePropertyMapping that match the given path "dot" path (a.bValue.value), or null if none exists.
 ResourcePropertyMapping[] getResourcePropertyMappings()
          Returns all the resource property mappings that are assoicated with the resource mapping.
 boolean isPoly()
           
 boolean isSupportUnmarshall()
           
 boolean isSupportUnmarshallSet()
           
 void setClassPath(PropertyPath classPath)
           
 void setClazz(Class clazz)
           
 void setConstructor(Constructor constructor)
           
 void setManagedId(ClassPropertyMapping.ManagedId managedId)
           
 void setPoly(boolean poly)
           
 void setPolyClass(Class polyClass)
           
 void setPolyConstructor(Constructor polyConstructor)
           
 void setSupportUnmarshall(boolean supportUnmarshall)
           
 AliasMapping shallowCopy()
          Performs a shalow copy of this mapping, not including any internal mappings belonging to MultipleMapping.
 
Methods inherited from class org.compass.core.mapping.AbstractResourceMapping
addMapping, copy, getAlias, getAllMapping, getAnalyzer, getAnalyzerController, getBoost, getBoostPropertyMapping, getCascadeMappings, getExtendedAliases, getExtendingAliases, getIdMappings, getResourceIdMappings, getResourcePropertyMapping, getResourcePropertyMappingByPath, getResourcePropertyMappings, getResourcePropertyNames, getSpellCheck, getSubIndexHash, getUIDPath, hasSpecificAnalyzerPerResourceProperty, isRoot, operationAllowed, postProcess, setAlias, setAllMapping, setAnalyzer, setAnalyzerController, setBoost, setBoostPropertyMapping, setCascades, setExtendedAliases, setExtendingAliases, setRoot, setSpellCheck, setSubIndexHash, setUIDPath, shallowCopy
 
Methods inherited from class org.compass.core.mapping.AbstractMultipleMapping
addMappings, clearMappings, copy, getMapping, getMapping, mappingsIt, mappingsSize, removeExistingByName, replaceMappings, shallowCopy
 
Methods inherited from class org.compass.core.mapping.AbstractMapping
controlsObjectNullability, copy, getConverter, getConverterName, getName, getPath, setConverter, setConverterName, setName, setPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.compass.core.mapping.ResourceMapping
getAllMapping, getAnalyzer, getAnalyzerController, getBoost, getBoostPropertyMapping, getCascadeMappings, getIdMappings, getResourceIdMappings, getResourcePropertyMapping, getResourcePropertyMappingByPath, getResourcePropertyMappings, getResourcePropertyNames, getSpellCheck, getSubIndexHash, getUIDPath, hasSpecificAnalyzerPerResourceProperty, isRoot, operationAllowed
 
Methods inherited from interface org.compass.core.mapping.AliasMapping
getAlias, getExtendedAliases, getExtendingAliases, setAlias, setAnalyzer, setExtendedAliases, setExtendingAliases
 
Methods inherited from interface org.compass.core.mapping.MultipleMapping
addMapping, getMapping, getMapping, mappingsIt
 
Methods inherited from interface org.compass.core.mapping.Mapping
controlsObjectNullability, getConverter, getConverterName, getName, getPath, setConverter, setConverterName, setName, setPath
 
Methods inherited from interface org.compass.core.mapping.PostProcessingMapping
postProcess
 

Constructor Detail

ClassMapping

public ClassMapping()
Method Detail

copy

public Mapping copy()
Description copied from interface: Mapping
Copies over the mapping definition into a newly instanciated Mapping object.

Specified by:
copy in interface Mapping

shallowCopy

public AliasMapping shallowCopy()
Description copied from interface: AliasMapping
Performs a shalow copy of this mapping, not including any internal mappings belonging to MultipleMapping.

Specified by:
shallowCopy in interface AliasMapping

doPostProcess

protected void doPostProcess()
                      throws MappingException
Post process by using the dynamic find operations to cache them.

Specified by:
doPostProcess in class AbstractResourceMapping
Throws:
MappingException

getResourcePropertyMappings

public ResourcePropertyMapping[] getResourcePropertyMappings()
Description copied from interface: ResourceMapping
Returns all the resource property mappings that are assoicated with the resource mapping. Note, that it is an important method, since it might be that not all the mappings that were added to the resource mapping are of type ResourcePropertyMapping, and using this method you can be assured that ALL the ResourcePropertyMappings will be returned (even deep ones).

Specified by:
getResourcePropertyMappings in interface ResourceMapping

getClassPropertyMappings

public ClassPropertyMapping[] getClassPropertyMappings()

getClassIdPropertyMappings

public ClassIdPropertyMapping[] getClassIdPropertyMappings()

findIdMappings

public List<Mapping> findIdMappings()
Dynamically find the id mappings.


findClassPropertyIdMappings

public List<ClassIdPropertyMapping> findClassPropertyIdMappings()
Dynamically finds all the ClassIdPropertyMappings for the class.


getResourcePropertyMappingByDotPath

public ResourcePropertyMapping getResourcePropertyMappingByDotPath(String path)
Description copied from interface: ResourceMapping
Returns the ResourcePropertyMapping that match the given path "dot" path (a.bValue.value), or null if none exists.

Specified by:
getResourcePropertyMappingByDotPath in interface ResourceMapping

getManagedId

public ClassPropertyMapping.ManagedId getManagedId()

setManagedId

public void setManagedId(ClassPropertyMapping.ManagedId managedId)

isPoly

public boolean isPoly()

setPoly

public void setPoly(boolean poly)

getClassPath

public PropertyPath getClassPath()

setClassPath

public void setClassPath(PropertyPath classPath)

getClazz

public Class getClazz()

setClazz

public void setClazz(Class clazz)

getPolyClass

public Class getPolyClass()
In case poly is set to true, this will be the class that will be instanciated for all persisted classes. If not set, Compass will persist the actual class in the index, and will use it to instanciate the class.


setPolyClass

public void setPolyClass(Class polyClass)

isSupportUnmarshall

public boolean isSupportUnmarshall()

setSupportUnmarshall

public void setSupportUnmarshall(boolean supportUnmarshall)

isSupportUnmarshallSet

public boolean isSupportUnmarshallSet()

getConstructor

public Constructor getConstructor()

setConstructor

public void setConstructor(Constructor constructor)

getPolyConstructor

public Constructor getPolyConstructor()

setPolyConstructor

public void setPolyConstructor(Constructor polyConstructor)


Copyright (c) 2004-2008 The Compass Project.