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

java.lang.Object
  extended by org.compass.core.mapping.json.builder.JSEM

public abstract class JSEM
extends Object

Static builder allowing to construct JSEM (JSON to Search Engine Mapping) definitions.

Here is an exmaple how it can be used:

 import static org.compass.core.mapping.jsem.builder.JSEM.*;


 conf.addResourceMapping(
          json("a")
              .add(id("id"))
              .add(property("value1"))
              .add(property("value2").store(Property.Store.YES).index(Property.Index.ANALYZED))
 );
 

Author:
kimchy

Method Summary
static JsonAllMappingBuilder all()
          Constructs a new all mapping definition that can be added to a json mapping builder using JsonMappingBuilder.all(JsonAllMappingBuilder).
static JsonAnalyzerMappingBuilder analyzer(String name)
          Constructs a new json analyzer property mapping using the specified name.
static JsonArrayMappingBuilder array()
          Constructs a new json array mapping that can be used with JsonArrayMappingBuilder.element(JsonArrayMappingBuilder).
static JsonArrayMappingBuilder array(String name)
          Constructs a enw json array mapping using the specified name.
static JsonBoostMappingBuilder boost(String name)
          Constructs a new json boost property mapping using the specified name.
static JsonContentMappingBuilder content(String name)
          Constructs a new json content mapping using the specified name.
static JsonContractMappingBuilder contract(String alias)
          Constrcuts a new contract json mapping builder that can later be extended by other contracts / json mappings.
static JsonIdMappingBuilder id(String name)
          Constructs a new json id mapping using the specified name.
static JsonMappingBuilder json(String alias)
          Constrcuts a new root json mapping builder.
static JsonObjectMappingBuilder object()
          Constructs a new json object mapping that can be used with JsonArrayMappingBuilder.element(JsonObjectMappingBuilder).
static JsonObjectMappingBuilder object(String name)
          Constructs a new json object mapping using the specified name.
static JsonPropertyMappingBuilder property()
          Constrcuts a new json property mapping that can be used with JsonArrayMappingBuilder.element(JsonPropertyMappingBuilder).
static JsonPropertyMappingBuilder property(String name)
          Constructs a new json property mapping using the specified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

json

public static JsonMappingBuilder json(String alias)
Constrcuts a new root json mapping builder. Note, at least one id mapping must be added to it.


contract

public static JsonContractMappingBuilder contract(String alias)
Constrcuts a new contract json mapping builder that can later be extended by other contracts / json mappings. Contract mappings allow to share common mapping definitions.


id

public static JsonIdMappingBuilder id(String name)
Constructs a new json id mapping using the specified name. Can then be added to a root json mapping builder using JsonMappingBuilder.add(JsonIdMappingBuilder).


property

public static JsonPropertyMappingBuilder property()
Constrcuts a new json property mapping that can be used with JsonArrayMappingBuilder.element(JsonPropertyMappingBuilder).


property

public static JsonPropertyMappingBuilder property(String name)
Constructs a new json property mapping using the specified name. Can then be added to a json mapping builder using JsonMappingBuilder.add(JsonPropertyMappingBuilder) or to a json object mapping builder using JsonObjectMappingBuilder.add(JsonPropertyMappingBuilder).


analyzer

public static JsonAnalyzerMappingBuilder analyzer(String name)
Constructs a new json analyzer property mapping using the specified name. Can then be added to a json mapping builder using JsonMappingBuilder.add(JsonAnalyzerMappingBuilder).


content

public static JsonContentMappingBuilder content(String name)
Constructs a new json content mapping using the specified name. Can be added to json mapping builder using JsonMappingBuilder.add(JsonContentMappingBuilder).


object

public static JsonObjectMappingBuilder object()
Constructs a new json object mapping that can be used with JsonArrayMappingBuilder.element(JsonObjectMappingBuilder).


object

public static JsonObjectMappingBuilder object(String name)
Constructs a new json object mapping using the specified name. Can be added to json mapping builder using JsonMappingBuilder.add(JsonObjectMappingBuilder).


array

public static JsonArrayMappingBuilder array()
Constructs a new json array mapping that can be used with JsonArrayMappingBuilder.element(JsonArrayMappingBuilder).


array

public static JsonArrayMappingBuilder array(String name)
Constructs a enw json array mapping using the specified name. Can be added to json mapping builder using JsonMappingBuilder.add(JsonArrayMappingBuilder).


boost

public static JsonBoostMappingBuilder boost(String name)
Constructs a new json boost property mapping using the specified name. Can then be added to a json mapping builder using JsonMappingBuilder.add(JsonBoostMappingBuilder).


all

public static JsonAllMappingBuilder all()
Constructs a new all mapping definition that can be added to a json mapping builder using JsonMappingBuilder.all(JsonAllMappingBuilder).



Copyright (c) 2004-2009 The Compass Project.