org.compass.core.mapping.osem
Class AbstractRefAliasMapping

java.lang.Object
  extended by org.compass.core.mapping.support.AbstractMapping
      extended by org.compass.core.mapping.osem.AbstractAccessorMapping
          extended by org.compass.core.mapping.osem.AbstractRefAliasMapping
All Implemented Interfaces:
CascadeMapping, InternalCascadeMapping, InternalMapping, Mapping, InternalObjectMapping, InternalOsemMapping, InternalRefAliasObjectMapping, ObjectMapping, OsemMapping, RefAliasObjectMapping
Direct Known Subclasses:
ComponentMapping, ReferenceMapping

public abstract class AbstractRefAliasMapping
extends AbstractAccessorMapping
implements InternalRefAliasObjectMapping, InternalCascadeMapping

Author:
kimchy

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.compass.core.mapping.CascadeMapping
CascadeMapping.Cascade
 
Constructor Summary
AbstractRefAliasMapping()
           
 
Method Summary
protected  void copy(AbstractRefAliasMapping mapping)
           
 CascadeMapping.Cascade[] getCascades()
          Returns the cascades of the mapping.
 Object getCascadeValue(Object root)
          Returns the value that should be cascaded basde on the root object.
 String[] getRefAliases()
           
 Class getRefClass()
          Returns the reference class which will be used if no ref aliases are explicitly defined using RefAliasObjectMapping.getRefAliases() to identify the alias.
 ClassMapping getRefClassMapping(String alias)
           
 ClassMapping[] getRefClassMappings()
           
 boolean hasAtLeastOneRefAlias(String[] refAliases)
           
 boolean hasRefAlias(String refAlias)
           
 void setCascades(CascadeMapping.Cascade[] cascades)
          Sets the cascade mapping definitions.
 void setRefAliases(String[] refAliases)
           
 void setRefClass(Class refClass)
          Sets a reference class which will be used if no ref aliases are explicitly defined using InternalRefAliasObjectMapping.setRefAliases(String[]) to identify the alias.
 void setRefClassMappings(ClassMapping[] refClassMappings)
           
 boolean shouldCascade(CascadeMapping.Cascade cascade)
          Returns true if cascading should be performed for the cascade parameter.
 boolean shouldCascadeCreate()
          Returns true if cascading should be performed for create operations.
 boolean shouldCascadeDelete()
          Returns true if cascading should be performed for delete operations.
 boolean shouldCascadeSave()
          Returns true if cascading should be performed for save operations.
 
Methods inherited from class org.compass.core.mapping.osem.AbstractAccessorMapping
copy, getAccessor, getDefinedInAlias, getGetter, getPropertyName, getSetter, hasAccessors, setAccessor, setDefinedInAlias, setGetter, setPropertyName, setSetter
 
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.osem.ObjectMapping
canBeCollectionWrapped, getAccessor, getDefinedInAlias, getGetter, getPropertyName, getSetter
 
Methods inherited from interface org.compass.core.mapping.osem.OsemMapping
hasAccessors
 
Methods inherited from interface org.compass.core.mapping.Mapping
controlsObjectNullability, copy, getConverter, getConverterName, getName, getPath
 
Methods inherited from interface org.compass.core.mapping.osem.internal.InternalObjectMapping
setAccessor, setDefinedInAlias, setGetter, setPropertyName, setSetter
 
Methods inherited from interface org.compass.core.mapping.osem.ObjectMapping
canBeCollectionWrapped, getAccessor, getDefinedInAlias, getGetter, getPropertyName, getSetter
 
Methods inherited from interface org.compass.core.mapping.osem.OsemMapping
hasAccessors
 
Methods inherited from interface org.compass.core.mapping.Mapping
controlsObjectNullability, copy, getConverter, getConverterName, getName, getPath
 
Methods inherited from interface org.compass.core.mapping.osem.OsemMapping
hasAccessors
 
Methods inherited from interface org.compass.core.mapping.Mapping
controlsObjectNullability, copy, getConverter, getConverterName, getName, getPath
 
Methods inherited from interface org.compass.core.mapping.internal.InternalMapping
setConverter, setConverterName, setName, setPath
 
Methods inherited from interface org.compass.core.mapping.Mapping
controlsObjectNullability, copy, getConverter, getConverterName, getName, getPath
 

Constructor Detail

AbstractRefAliasMapping

public AbstractRefAliasMapping()
Method Detail

copy

protected void copy(AbstractRefAliasMapping mapping)

hasRefAlias

public boolean hasRefAlias(String refAlias)
Specified by:
hasRefAlias in interface RefAliasObjectMapping

hasAtLeastOneRefAlias

public boolean hasAtLeastOneRefAlias(String[] refAliases)
Specified by:
hasAtLeastOneRefAlias in interface RefAliasObjectMapping

getRefClassMapping

public ClassMapping getRefClassMapping(String alias)
Specified by:
getRefClassMapping in interface RefAliasObjectMapping

getRefAliases

public String[] getRefAliases()
Specified by:
getRefAliases in interface RefAliasObjectMapping

setRefAliases

public void setRefAliases(String[] refAliases)
Specified by:
setRefAliases in interface InternalRefAliasObjectMapping

getRefClassMappings

public ClassMapping[] getRefClassMappings()
Specified by:
getRefClassMappings in interface RefAliasObjectMapping

setRefClassMappings

public void setRefClassMappings(ClassMapping[] refClassMappings)
Specified by:
setRefClassMappings in interface InternalRefAliasObjectMapping

getRefClass

public Class getRefClass()
Description copied from interface: RefAliasObjectMapping
Returns the reference class which will be used if no ref aliases are explicitly defined using RefAliasObjectMapping.getRefAliases() to identify the alias.

Specified by:
getRefClass in interface RefAliasObjectMapping

setRefClass

public void setRefClass(Class refClass)
Description copied from interface: InternalRefAliasObjectMapping
Sets a reference class which will be used if no ref aliases are explicitly defined using InternalRefAliasObjectMapping.setRefAliases(String[]) to identify the alias.

Specified by:
setRefClass in interface InternalRefAliasObjectMapping

getCascades

public CascadeMapping.Cascade[] getCascades()
Description copied from interface: CascadeMapping
Returns the cascades of the mapping.

Specified by:
getCascades in interface CascadeMapping

setCascades

public void setCascades(CascadeMapping.Cascade[] cascades)
Description copied from interface: InternalCascadeMapping
Sets the cascade mapping definitions.

Specified by:
setCascades in interface InternalCascadeMapping

getCascadeValue

public Object getCascadeValue(Object root)
                       throws CompassException
Description copied from interface: CascadeMapping
Returns the value that should be cascaded basde on the root object.

Specified by:
getCascadeValue in interface CascadeMapping
Parameters:
root - The root object to extract the cascaded value from
Returns:
The cascaded value to cascade
Throws:
CompassException

shouldCascadeDelete

public boolean shouldCascadeDelete()
Description copied from interface: CascadeMapping
Returns true if cascading should be performed for delete operations.

Specified by:
shouldCascadeDelete in interface CascadeMapping

shouldCascadeCreate

public boolean shouldCascadeCreate()
Description copied from interface: CascadeMapping
Returns true if cascading should be performed for create operations.

Specified by:
shouldCascadeCreate in interface CascadeMapping

shouldCascadeSave

public boolean shouldCascadeSave()
Description copied from interface: CascadeMapping
Returns true if cascading should be performed for save operations.

Specified by:
shouldCascadeSave in interface CascadeMapping

shouldCascade

public boolean shouldCascade(CascadeMapping.Cascade cascade)
Description copied from interface: CascadeMapping
Returns true if cascading should be performed for the cascade parameter.

Specified by:
shouldCascade in interface CascadeMapping


Copyright (c) 2004-2008 The Compass Project.