org.compass.core.mapping.osem
Class AbstractRefAliasMapping

java.lang.Object
  extended by org.compass.core.mapping.AbstractMapping
      extended by org.compass.core.mapping.osem.AbstractAccessorMapping
          extended by org.compass.core.mapping.osem.AbstractRefAliasMapping
All Implemented Interfaces:
CascadeMapping, Mapping, HasRefAliasMapping, ObjectMapping, OsemMapping
Direct Known Subclasses:
ComponentMapping, ReferenceMapping

public abstract class AbstractRefAliasMapping
extends AbstractAccessorMapping
implements HasRefAliasMapping, CascadeMapping

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()
           
 Object getCascadeValue(Object root)
          Returns the value that should be cascaded basde on the root object.
 String[] getRefAliases()
           
 Class getRefClass()
           
 ClassMapping getRefClassMapping(String alias)
           
 ClassMapping[] getRefClassMappings()
           
 boolean hasAtLeastOneRefAlias(String[] refAliases)
           
 boolean hasRefAlias(String refAlias)
           
 void setCascades(CascadeMapping.Cascade[] cascades)
           
 void setRefAliases(String[] refAliases)
           
 void setRefClass(Class refClass)
          Sets a reference class which will be used if no ref aliases are explicitly defined using HasRefAliasMapping.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.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, setAccessor, setDefinedInAlias, setGetter, setPropertyName, setSetter
 
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, setConverter, setConverterName, setName, setPath
 

Constructor Detail

AbstractRefAliasMapping

public AbstractRefAliasMapping()
Method Detail

copy

protected void copy(AbstractRefAliasMapping mapping)

hasRefAlias

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

hasAtLeastOneRefAlias

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

getRefClassMapping

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

getRefAliases

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

setRefAliases

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

getRefClassMappings

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

setRefClassMappings

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

getRefClass

public Class getRefClass()
Specified by:
getRefClass in interface HasRefAliasMapping

setRefClass

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

Specified by:
setRefClass in interface HasRefAliasMapping

getCascades

public CascadeMapping.Cascade[] getCascades()
Specified by:
getCascades in interface CascadeMapping

setCascades

public void setCascades(CascadeMapping.Cascade[] cascades)
Specified by:
setCascades in interface CascadeMapping

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.