org.compass.core.mapping.rsem.builder
Class ResourceMappingBuilder

java.lang.Object
  extended by org.compass.core.mapping.rsem.builder.ResourceMappingBuilder
All Implemented Interfaces:
ResourceMappingProvider

public class ResourceMappingBuilder
extends Object
implements ResourceMappingProvider

A builder allowing to constrcut resource mapping definition.

Author:
kimchy
See Also:
RSEM.resource(String)

Constructor Summary
ResourceMappingBuilder(String alias)
          Constructs the builder based on the specified alias.
 
Method Summary
 ResourceMappingBuilder add(ResourceAnalyzerMappingBuilder builder)
          Adds a resource analyzer property mapping definition.
 ResourceMappingBuilder add(ResourceBoostMappingBuilder builder)
          Adds a resource boost property mapping definition.
 ResourceMappingBuilder add(ResourceIdMappingBuilder builder)
          Adds a resource id mapping definition.
 ResourceMappingBuilder add(ResourcePropertyMappingBuilder builder)
          Adds a resource property mapping definition.
 ResourceMappingBuilder all(ResourceAllMappingBuilder allMappingBuilder)
          Sets the "all" level mapping definition.
 ResourceMappingBuilder analyzer(String analyzer)
          The name of the analyzer that will be used to analyze ANALYZED properties.
 ResourceMappingBuilder boost(float boost)
          Sets the boost value for the resource.
 ResourceMappingBuilder extendsAliases(String... extendedAliases)
          Sets the list of other resource/contract mappings that this mapping will extend and inherit internal mappings from.
 ResourceMapping getMapping()
          Returns the mapping constructed.
 ResourceMappingBuilder spellCheck(SpellCheck spellCheck)
          Sets the spell check mode that will be used for this resource mapping (and for all the internal mappings that do not explicitly set their own spell check mode).
 ResourceMappingBuilder subIndex(String subIndex)
          Sets a sub index that will be used for this resource.
 ResourceMappingBuilder subIndex(SubIndexHash subIndexHash)
          Sets a custom sub index hashing strategy for the resource mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceMappingBuilder

public ResourceMappingBuilder(String alias)
Constructs the builder based on the specified alias.

Method Detail

getMapping

public ResourceMapping getMapping()
Returns the mapping constructed. Used in CompassConfiguration.addMapping(org.compass.core.mapping.ResourceMappingProvider).

Specified by:
getMapping in interface ResourceMappingProvider

subIndex

public ResourceMappingBuilder subIndex(String subIndex)
Sets a sub index that will be used for this resource. Basically uses ConstantSubIndexHash.


subIndex

public ResourceMappingBuilder subIndex(SubIndexHash subIndexHash)
Sets a custom sub index hashing strategy for the resource mapping.


extendsAliases

public ResourceMappingBuilder extendsAliases(String... extendedAliases)
Sets the list of other resource/contract mappings that this mapping will extend and inherit internal mappings from.


spellCheck

public ResourceMappingBuilder spellCheck(SpellCheck spellCheck)
Sets the spell check mode that will be used for this resource mapping (and for all the internal mappings that do not explicitly set their own spell check mode). If not set will use the global spell check setting.


analyzer

public ResourceMappingBuilder analyzer(String analyzer)
The name of the analyzer that will be used to analyze ANALYZED properties. Defaults to the default analyzer which is one of the internal analyzers that comes with Compass. If not set, will use the default analyzer.

Note, that when using the resource-analyzer mapping (a child mapping of resource mapping) (for a resource property value that controls the analyzer), the analyzer attribute will have no effects.


boost

public ResourceMappingBuilder boost(float boost)
Sets the boost value for the resource.


all

public ResourceMappingBuilder all(ResourceAllMappingBuilder allMappingBuilder)
Sets the "all" level mapping definition.


add

public ResourceMappingBuilder add(ResourceIdMappingBuilder builder)
Adds a resource id mapping definition.


add

public ResourceMappingBuilder add(ResourcePropertyMappingBuilder builder)
Adds a resource property mapping definition.


add

public ResourceMappingBuilder add(ResourceAnalyzerMappingBuilder builder)
Adds a resource analyzer property mapping definition.


add

public ResourceMappingBuilder add(ResourceBoostMappingBuilder builder)
Adds a resource boost property mapping definition.



Copyright (c) 2004-2009 The Compass Project.