|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.mapping.internal.DefaultCompassMapping
public class DefaultCompassMapping
| Constructor Summary | |
|---|---|
DefaultCompassMapping()
|
|
| Method Summary | |
|---|---|
void |
addMapping(AliasMapping mapping)
Adds the given Alias mapping. |
void |
clearCache()
|
void |
clearMappings()
|
InternalCompassMapping |
copy(ConverterLookup converterLookup)
|
ResourceMapping |
findNonRootMappingByClass(Class clazz)
Finds a non root mapping by the class name. |
ResourceMapping |
findRootMappingByClass(Class clazz)
Finds a root mapping by the class name. |
AliasMapping |
getAliasMapping(String alias)
Returns the alias mapping for the given alias (most if not all of the times, this will be a ResourceMapping). |
List<ResourceMapping> |
getAllDirectMappingByClass(Class clazz)
Returns all the direct class mapping for the given class (root or not). |
ConverterLookup |
getConverterLookup()
Returns the converter lookup. |
ResourceMapping |
getDirectMappingByClass(Class clazz)
Returns the direct class mapping for the given class (root or not). |
ResourceMapping |
getMappingByAlias(String alias)
Returns the resource mapping for the given alias. |
ResourceMapping |
getMappingByClass(Class clazz)
Finds the Resource mapping that is the "nearest" to the provided class. |
AliasMapping[] |
getMappings()
Returns an array of all the current mappings. |
ResourceMapping |
getNonRootMappingByAlias(String alias)
Returns the non root resource mapping associated with the alias. |
ResourceMapping |
getNonRootMappingByClass(Class clazz)
Does exactly the same as findNonRootMappingByClass(Class), but returns null
if nothing is found (does not throw an exception). |
PropertyPath |
getPath()
Returns the root path of the mappings. |
ResourcePropertyLookup |
getResourcePropertyLookup(String name)
Returns a resoruce lookup for a specific name. |
ResourcePropertyMapping |
getResourcePropertyMappingByPath(String path)
Finds the ResourcePropertyMapping definition for the specified path. |
ResourcePropertyMapping[] |
getResourcePropertyMappingsByPath(String path)
Returns an array of all the given ResourcePropertyMapping for the given
path. |
ResourceMapping |
getRootMappingByAlias(String alias)
Returns the root resource mapping associated with the alias. |
ResourceMapping |
getRootMappingByClass(Class clazz)
Does exactly the same as findRootMappingByClass(Class), but returns null
if nothing is found (does not throw an exception). |
ResourceMapping[] |
getRootMappings()
Returns all the root resource mappings. |
boolean |
hasMappingForAlias(String alias,
CascadeMapping.Cascade cascade)
Returns true if the given alias has either root mappings, or if it has
a non root mapping, it has mappings for the given cascade operation. |
boolean |
hasMappingForClass(Class clazz,
CascadeMapping.Cascade cascade)
Returns true if the given class has either root mappings, or if it has
a non root mapping, it has mappings for the given cascade operation. |
boolean |
hasMultipleRootClassMapping(String className)
Returns true if the given className has multiple class mappings. |
boolean |
hasRootClassMapping(String alias)
Returns true if there is a root ClassMapping
for the given alias. |
boolean |
hasRootMappingByAlias(String alias)
Returns true if the given alias has a root resource mapping. |
boolean |
hasRootRawResourceMapping(String alias)
Returns true if there is a root RawResourceMapping
for the given alias. |
void |
postProcess()
|
boolean |
removeMappingByAlias(String alias)
|
boolean |
removeMappingByClass(String className)
|
void |
setPath(PropertyPath path)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultCompassMapping()
| Method Detail |
|---|
public InternalCompassMapping copy(ConverterLookup converterLookup)
copy in interface InternalCompassMappingpublic void postProcess()
postProcess in interface InternalCompassMappingpublic void clearMappings()
clearMappings in interface InternalCompassMappingpublic void clearCache()
public void addMapping(AliasMapping mapping)
throws MappingException
addMapping in interface InternalCompassMappingMappingException
public boolean removeMappingByClass(String className)
throws MappingException
removeMappingByClass in interface InternalCompassMappingMappingException
public boolean removeMappingByAlias(String alias)
throws MappingException
removeMappingByAlias in interface InternalCompassMappingMappingException
public ResourcePropertyLookup getResourcePropertyLookup(String name)
throws IllegalArgumentException
getResourcePropertyLookup in interface CompassMappingIllegalArgumentExceptionpublic ResourcePropertyMapping getResourcePropertyMappingByPath(String path)
ResourcePropertyMapping definition for the specified path. The
path is in the format of: [alias].[class property mapping].[meta data mapping] in
case of class mapping, and [alias].[resource property mapping] in case of resource
mapping. The format of [alias].[class property mapping] can also be applied, and
will result in the meta data id of the given class property mapping.
getResourcePropertyMappingByPath in interface CompassMappingpath - the path to the resource property mapping
public ResourcePropertyMapping[] getResourcePropertyMappingsByPath(String path)
ResourcePropertyMapping for the given
path. If the path is in "dot path" notation, will reutrn a single mappings matching it (see
getResourcePropertyMappingByPath(String)). Otherwise will return all the ones mapped to
the given name.
getResourcePropertyMappingsByPath in interface CompassMappingpublic AliasMapping[] getMappings()
getMappings in interface CompassMappingpublic AliasMapping getAliasMapping(String alias)
ResourceMapping).
getAliasMapping in interface CompassMappingpublic ResourceMapping getMappingByAlias(String alias)
getMappingByAlias in interface CompassMappingpublic ResourceMapping getRootMappingByAlias(String alias)
null if no root mapping (or no mapping) is associated with the alias.
getRootMappingByAlias in interface CompassMappingpublic ResourceMapping getNonRootMappingByAlias(String alias)
null if no non root mapping (or no mapping) is associated with the alias.
getNonRootMappingByAlias in interface CompassMappingpublic boolean hasRootMappingByAlias(String alias)
true if the given alias has a root resource mapping.
hasRootMappingByAlias in interface CompassMappingpublic boolean hasRootClassMapping(String alias)
true if there is a root ClassMapping
for the given alias.
hasRootClassMapping in interface CompassMappingpublic boolean hasRootRawResourceMapping(String alias)
true if there is a root RawResourceMapping
for the given alias.
hasRootRawResourceMapping in interface CompassMappingpublic boolean hasMultipleRootClassMapping(String className)
true if the given className has multiple class mappings.
hasMultipleRootClassMapping in interface CompassMappingpublic ResourceMapping getDirectMappingByClass(Class clazz)
If a class has more than one mappings (using differnet aliases) will return the first one.
getDirectMappingByClass in interface CompassMappingpublic List<ResourceMapping> getAllDirectMappingByClass(Class clazz)
getAllDirectMappingByClass in interface CompassMapping
public boolean hasMappingForClass(Class clazz,
CascadeMapping.Cascade cascade)
CompassMappingtrue if the given class has either root mappings, or if it has
a non root mapping, it has mappings for the given cascade operation.
hasMappingForClass in interface CompassMapping
public boolean hasMappingForAlias(String alias,
CascadeMapping.Cascade cascade)
CompassMappingtrue if the given alias has either root mappings, or if it has
a non root mapping, it has mappings for the given cascade operation.
hasMappingForAlias in interface CompassMappingpublic ResourceMapping getMappingByClass(Class clazz)
findRootMappingByClass(Class) except the search
is on all the ClassMappings (even ones that are not marked as root).
getMappingByClass in interface CompassMapping
public ResourceMapping findRootMappingByClass(Class clazz)
throws MappingException
findRootMappingByClass in interface CompassMappingclazz - The class to find root mapping for
MappingException
public ResourceMapping getRootMappingByClass(Class clazz)
throws MappingException
findRootMappingByClass(Class), but returns null
if nothing is found (does not throw an exception).
getRootMappingByClass in interface CompassMappingMappingException
public ResourceMapping findNonRootMappingByClass(Class clazz)
throws MappingException
findNonRootMappingByClass in interface CompassMappingclazz - The class to find root mapping for
MappingException
public ResourceMapping getNonRootMappingByClass(Class clazz)
throws MappingException
findNonRootMappingByClass(Class), but returns null
if nothing is found (does not throw an exception).
getNonRootMappingByClass in interface CompassMappingMappingExceptionpublic ResourceMapping[] getRootMappings()
CompassMapping
getRootMappings in interface CompassMappingpublic ConverterLookup getConverterLookup()
CompassMapping
getConverterLookup in interface CompassMappingpublic PropertyPath getPath()
CompassMapping
getPath in interface CompassMappingpublic void setPath(PropertyPath path)
setPath in interface InternalCompassMapping
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||