org.compass.core.mapping.json.builder
Class JsonContractMappingBuilder

java.lang.Object
  extended by org.compass.core.mapping.json.builder.JsonContractMappingBuilder
All Implemented Interfaces:
ContractMappingProvider

public class JsonContractMappingBuilder
extends Object
implements ContractMappingProvider

A builder allowing to constrcut json contract mapping definition. Contract mappings allow to share common mapping definitions.

Author:
kimchy
See Also:
JSEM.contract(String)

Constructor Summary
JsonContractMappingBuilder(String alias)
          Constructs a new contract JSON Mapping based on the specified alias.
 
Method Summary
 JsonContractMappingBuilder add(JsonAnalyzerMappingBuilder builder)
          Adds a json analyzer property mapping definition.
 JsonContractMappingBuilder add(JsonArrayMappingBuilder builder)
          Adds a json array mapping definition.
 JsonContractMappingBuilder add(JsonBoostMappingBuilder builder)
          Adds a json boost property mapping definition.
 JsonContractMappingBuilder add(JsonContentMappingBuilder builder)
          Adds a json content mapping definition.
 JsonContractMappingBuilder add(JsonIdMappingBuilder builder)
          Adds a json id mapping definition.
 JsonContractMappingBuilder add(JsonObjectMappingBuilder builder)
          Adds a json object mapping definition.
 JsonContractMappingBuilder add(JsonPropertyMappingBuilder builder)
          Adds a json property mapping definition.
 JsonContractMappingBuilder analyzer(String analyzer)
          The name of the analyzer that will be used to analyze ANALYZED properties.
 JsonContractMappingBuilder extendsAliases(String... extendedAliases)
          Sets the list of other json mappings that this mapping will extend and inherit internal mappings from.
 ContractMapping getMapping()
          Returns the contract mapping built.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonContractMappingBuilder

public JsonContractMappingBuilder(String alias)
Constructs a new contract JSON Mapping based on the specified alias.

Method Detail

getMapping

public ContractMapping getMapping()
Returns the contract mapping built.

Specified by:
getMapping in interface ContractMappingProvider

extendsAliases

public JsonContractMappingBuilder extendsAliases(String... extendedAliases)
Sets the list of other json mappings that this mapping will extend and inherit internal mappings from.


analyzer

public JsonContractMappingBuilder 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 json-analyzer mapping (a child mapping of json mapping) (for a json property value that controls the analyzer), the analyzer attribute will have no effects.


add

public JsonContractMappingBuilder add(JsonIdMappingBuilder builder)
Adds a json id mapping definition.


add

public JsonContractMappingBuilder add(JsonPropertyMappingBuilder builder)
Adds a json property mapping definition.


add

public JsonContractMappingBuilder add(JsonAnalyzerMappingBuilder builder)
Adds a json analyzer property mapping definition.


add

public JsonContractMappingBuilder add(JsonBoostMappingBuilder builder)
Adds a json boost property mapping definition.


add

public JsonContractMappingBuilder add(JsonContentMappingBuilder builder)
Adds a json content mapping definition.


add

public JsonContractMappingBuilder add(JsonObjectMappingBuilder builder)
Adds a json object mapping definition.


add

public JsonContractMappingBuilder add(JsonArrayMappingBuilder builder)
Adds a json array mapping definition.



Copyright (c) 2004-2009 The Compass Project.