org.compass.core.mapping
Interface ResourceMapping

All Superinterfaces:
AliasMapping, Mapping, MultipleMapping
All Known Subinterfaces:
InternalResourceMapping
All Known Implementing Classes:
AbstractResourceMapping, ClassMapping, NullResourceMapping, RawResourceMapping, XmlObjectMapping

public interface ResourceMapping
extends AliasMapping

A mapping defining a Resource saved in the Search Engine.

Author:
kimchy

Method Summary
 AllMapping getAllMapping()
          Returns a set of settings associated with the all mappings.
 String getAnalyzer()
          Returns the analyzer name that need to be used with the resouce.
 ResourceAnalyzerController getAnalyzerController()
          Returns the analzer controller that is associated with the Resource.
 float getBoost()
          Returns the boost of the given resource.
 BoostPropertyMapping getBoostPropertyMapping()
          Returns an optional boost property mapping associated with the Resource in order to dynmaically set the resource boost value based on it.
 CascadeMapping[] getCascadeMappings()
          Returns a list of all the cascade mappings.
 Mapping[] getIdMappings()
          Returns all mappings that represent ids of a resource.
 ResourcePropertyMapping[] getResourceIdMappings()
          Returns all the id mappigns for the low level resource mapping.
 ResourcePropertyMapping getResourcePropertyMapping(String propertyName)
          Returns the first resource property mapping that match the given proeprty name (Mapping.getName(), or null if not exists.
 ResourcePropertyMapping getResourcePropertyMappingByDotPath(String path)
          Returns the ResourcePropertyMapping that match the given path "dot" path (a.bValue.value), or null if none exists.
 ResourcePropertyMapping getResourcePropertyMappingByPath(PropertyPath path)
          Returns the ResourcePropertyMapping that match the given path (Mapping.getPath(), or null of not exists.
 ResourcePropertyMapping[] getResourcePropertyMappings()
          Returns all the resource property mappings that are assoicated with the resource mapping.
 ResourcePropertyMapping[] getResourcePropertyMappings(String propertyName)
          Returns the list of resource property mappings that match the given proeprty name (Mapping.getName(), or null if not exists.
 String[] getResourcePropertyNames()
          Returns all the mapped property names for the resoruce.
 SpellCheckType getSpellCheck()
          Returns the default spell check mode.
 SubIndexHash getSubIndexHash()
          The sub index that the Resource will be saved to in the search engine.
 String getUIDPath()
          Returns the uid property name.
 boolean hasSpecificAnalyzerPerResourceProperty()
          Returns true if the resource proeprty mapping of the resource have a specific analyzer set.
 boolean isRoot()
          Returns true if it is a root resource mapping.
 boolean operationAllowed(CascadeMapping.Cascade cascade)
          Returns is an operation is allowed to be performed on this resoruce mappings.
 
Methods inherited from interface org.compass.core.mapping.AliasMapping
getAlias, getExtendedAliases, getExtendingAliases, setAlias, setAnalyzer, setExtendedAliases, setExtendingAliases, shallowCopy
 
Methods inherited from interface org.compass.core.mapping.MultipleMapping
addMapping, getMapping, getMapping, mappingsIt
 
Methods inherited from interface org.compass.core.mapping.Mapping
controlsObjectNullability, copy, getConverter, getConverterName, getName, getPath, setConverter, setConverterName, setName, setPath
 

Method Detail

getSubIndexHash

SubIndexHash getSubIndexHash()
The sub index that the Resource will be saved to in the search engine.


getAnalyzer

String getAnalyzer()
Returns the analyzer name that need to be used with the resouce. Can be null.

Specified by:
getAnalyzer in interface AliasMapping

hasSpecificAnalyzerPerResourceProperty

boolean hasSpecificAnalyzerPerResourceProperty()
Returns true if the resource proeprty mapping of the resource have a specific analyzer set.


getAnalyzerController

ResourceAnalyzerController getAnalyzerController()
Returns the analzer controller that is associated with the Resource. Can be null.


getBoostPropertyMapping

BoostPropertyMapping getBoostPropertyMapping()
Returns an optional boost property mapping associated with the Resource in order to dynmaically set the resource boost value based on it. Can be null.


getBoost

float getBoost()
Returns the boost of the given resource.


isRoot

boolean isRoot()
Returns true if it is a root resource mapping. If it is a root mapping, then it controlls the general Resource level settings like alias and sub-index. Usually, non-root resource mapping are mappings that are incorporated within another resoruce.


getAllMapping

AllMapping getAllMapping()
Returns a set of settings associated with the all mappings.


getIdMappings

Mapping[] getIdMappings()
Returns all mappings that represent ids of a resource.


getSpellCheck

SpellCheckType getSpellCheck()
Returns the default spell check mode. If NA, will use global setting.


getUIDPath

String getUIDPath()
Returns the uid property name.


getResourceIdMappings

ResourcePropertyMapping[] getResourceIdMappings()
Returns all the id mappigns for the low level resource mapping.


getCascadeMappings

CascadeMapping[] getCascadeMappings()
Returns a list of all the cascade mappings. Will return null if no cascading is defined.


operationAllowed

boolean operationAllowed(CascadeMapping.Cascade cascade)
Returns is an operation is allowed to be performed on this resoruce mappings. Root mappings (isRoot() always return true, while if it is non root mappings, it should return true if it has cascade mappings that map one of the cascade operations.


getResourcePropertyNames

String[] getResourcePropertyNames()
Returns all the mapped property names for the resoruce.


getResourcePropertyMappings

ResourcePropertyMapping[] getResourcePropertyMappings()
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).


getResourcePropertyMapping

ResourcePropertyMapping getResourcePropertyMapping(String propertyName)
Returns the first resource property mapping that match the given proeprty name (Mapping.getName(), or null if not exists.


getResourcePropertyMappings

ResourcePropertyMapping[] getResourcePropertyMappings(String propertyName)
Returns the list of resource property mappings that match the given proeprty name (Mapping.getName(), or null if not exists.


getResourcePropertyMappingByPath

ResourcePropertyMapping getResourcePropertyMappingByPath(PropertyPath path)
Returns the ResourcePropertyMapping that match the given path (Mapping.getPath(), or null of not exists.


getResourcePropertyMappingByDotPath

ResourcePropertyMapping getResourcePropertyMappingByDotPath(String path)
Returns the ResourcePropertyMapping that match the given path "dot" path (a.bValue.value), or null if none exists.



Copyright (c) 2004-2008 The Compass Project.