org.compass.core.mapping.osem
Class ClassMapping

java.lang.Object
  extended by org.compass.core.mapping.support.AbstractMapping
      extended by org.compass.core.mapping.support.AbstractMultipleMapping
          extended by org.compass.core.mapping.support.AbstractResourceMapping
              extended by org.compass.core.mapping.osem.ClassMapping
All Implemented Interfaces:
AliasMapping, InternalAliasMapping, InternalMapping, InternalMultipleMapping, InternalResourceMapping, PostProcessingMapping, Mapping, MultipleMapping, 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.support.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<ClassPropertyMapping> findClassPropertiesRequireProcessing()
           
 List<ClassIdPropertyMapping> findClassPropertyIdMappings()
          Dynamically finds all the ClassIdPropertyMappings for the class.
 List<Mapping> findIdMappings()
          Dynamically find the id mappings.
 PropertyPath getBasePath()
           
 ClassIdPropertyMapping[] getClassIdPropertyMappings()
           
 PropertyPath getClassPath()
           
 ClassPropertyMapping[] getClassPropertyMappings()
           
 Class getClazz()
           
 ReflectionConstructor getConstructor()
           
 PropertyPath getEnumNamePath()
           
 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.
 ReflectionConstructor 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 isFilterDuplicates()
           
 boolean isPoly()
           
 boolean isSupportUnmarshall()
           
 boolean isSupportUnmarshallSet()
           
 void setBasePath(PropertyPath basePath)
           
 void setClassPath(PropertyPath classPath)
           
 void setClazz(Class clazz)
           
 void setConstructor(ReflectionConstructor constructor)
           
 void setEnumNamePath(PropertyPath enumNamePath)
           
 void setFilterDuplicates(Boolean filterDuplicates)
           
 void setManagedId(ClassPropertyMapping.ManagedId managedId)
           
 void setPoly(boolean poly)
           
 void setPolyClass(Class polyClass)
           
 void setPolyConstructor(ReflectionConstructor 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.support.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.support.AbstractMultipleMapping
addMappings, clearMappings, copy, getMapping, getMapping, mappingsIt, mappingsSize, removeExistingByName, replaceMappings, shallowCopy
 
Methods inherited from class org.compass.core.mapping.support.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
 
Methods inherited from interface org.compass.core.mapping.MultipleMapping
getMapping, getMapping, mappingsIt
 
Methods inherited from interface org.compass.core.mapping.Mapping
controlsObjectNullability, getConverter, getConverterName, getName, getPath
 
Methods inherited from interface org.compass.core.mapping.internal.PostProcessingMapping
postProcess
 
Methods inherited from interface org.compass.core.mapping.internal.InternalMapping
setConverter, setConverterName, setName, setPath
 

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.


findClassPropertiesRequireProcessing

public List<ClassPropertyMapping> findClassPropertiesRequireProcessing()

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)

getEnumNamePath

public PropertyPath getEnumNamePath()

setEnumNamePath

public void setEnumNamePath(PropertyPath enumNamePath)

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()

isFilterDuplicates

public Boolean isFilterDuplicates()

setFilterDuplicates

public void setFilterDuplicates(Boolean filterDuplicates)

getConstructor

public ReflectionConstructor getConstructor()

setConstructor

public void setConstructor(ReflectionConstructor constructor)

getPolyConstructor

public ReflectionConstructor getPolyConstructor()

setPolyConstructor

public void setPolyConstructor(ReflectionConstructor polyConstructor)

getBasePath

public PropertyPath getBasePath()

setBasePath

public void setBasePath(PropertyPath basePath)


Copyright (c) 2004-2008 The Compass Project.