org.compass.core.mapping.json
Class RootJsonObjectMapping

java.lang.Object
  extended by org.compass.core.mapping.support.AbstractMapping
      extended by org.compass.core.mapping.support.AbstractMultipleMapping
          extended by org.compass.core.mapping.support.AbstractResourceMapping
              extended by org.compass.core.mapping.json.RootJsonObjectMapping
All Implemented Interfaces:
AliasMapping, InternalAliasMapping, InternalMapping, InternalMultipleMapping, InternalResourceMapping, PostProcessingMapping, JsonMapping, JsonObjectMapping, Mapping, MultipleMapping, ResourceMapping

public class RootJsonObjectMapping
extends AbstractResourceMapping
implements JsonObjectMapping

Author:
kimchy

Field Summary
 
Fields inherited from class org.compass.core.mapping.support.AbstractMultipleMapping
mappings, mappingsByNameMap
 
Constructor Summary
RootJsonObjectMapping()
           
 
Method Summary
 int addMapping(Mapping mapping)
          No duplicate names are allowed when added an id (applies the property names)
 Mapping copy()
          Copies over the mapping definition into a newly instanciated Mapping object.
protected  void doPostProcess()
           
 JsonContentMapping getContentMapping()
           
 Naming getDynamicNaming()
           
 String getFullPath()
          Returns a dot path to the mapping from the root.
 ResourcePropertyMapping getResourcePropertyMappingByDotPath(String path)
          Returns the ResourcePropertyMapping that match the given path "dot" path (a.bValue.value), or null if none exists.
 ResourcePropertyMapping[] getResourcePropertyMappings()
          Returns all the resource property mappings that are assoicated with the resource mapping.
 boolean isDynamic()
           
 void setDynamic(boolean dynamic)
           
 void setDynamicNaming(Naming dynamicNaming)
           
 void setFullPath(String fullPath)
          Sets the full path (dot path notation) of the given root.
 AliasMapping shallowCopy()
          Performs a shalow copy of this mapping, not including any internal mappings belonging to MultipleMapping.
 
Methods inherited from class org.compass.core.mapping.support.AbstractResourceMapping
copy, getAlias, getAllMapping, getAnalyzer, getAnalyzerController, getBoost, getBoostPropertyMapping, getCascadeMappings, getExtendedAliases, getExtendingAliases, getIdMappings, getResourceIdMappings, getResourcePropertyMapping, getResourcePropertyMappingByPath, getResourcePropertyMappings, getResourcePropertyNames, getSpellCheck, getSubIndexHash, getUIDPath, hasSpecificAnalyzerPerResourceProperty, isRoot, operationAllowed, postProcess, setAlias, setAllMapping, setAnalyzer, setAnalyzerController, setBoost, setBoostPropertyMapping, setCascades, setExtendedAliases, setExtendingAliases, setRoot, setSpellCheck, setSubIndexHash, setUIDPath, shallowCopy
 
Methods inherited from class org.compass.core.mapping.support.AbstractMultipleMapping
addMappings, clearMappings, copy, getMapping, getMapping, mappingsIt, mappingsSize, removeExistingByName, replaceMappings, shallowCopy
 
Methods inherited from class org.compass.core.mapping.support.AbstractMapping
controlsObjectNullability, copy, getConverter, getConverterName, getName, getPath, setConverter, setConverterName, setName, setPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.compass.core.mapping.MultipleMapping
getMapping, getMapping, mappingsIt
 
Methods inherited from interface org.compass.core.mapping.Mapping
controlsObjectNullability, getConverter, getConverterName, getName, getPath
 
Methods inherited from interface org.compass.core.mapping.Mapping
controlsObjectNullability, getConverter, getConverterName, getName, getPath
 
Methods inherited from interface org.compass.core.mapping.internal.InternalMapping
setConverter, setConverterName, setName, setPath
 

Constructor Detail

RootJsonObjectMapping

public RootJsonObjectMapping()
Method Detail

copy

public Mapping copy()
Description copied from interface: Mapping
Copies over the mapping definition into a newly instanciated Mapping object.

Specified by:
copy in interface Mapping

shallowCopy

public AliasMapping shallowCopy()
Description copied from interface: AliasMapping
Performs a shalow copy of this mapping, not including any internal mappings belonging to MultipleMapping.

Specified by:
shallowCopy in interface AliasMapping

getFullPath

public String getFullPath()
Description copied from interface: JsonMapping
Returns a dot path to the mapping from the root.

Specified by:
getFullPath in interface JsonMapping

setFullPath

public void setFullPath(String fullPath)
Description copied from interface: JsonMapping
Sets the full path (dot path notation) of the given root.

Specified by:
setFullPath in interface JsonMapping

isDynamic

public boolean isDynamic()
Specified by:
isDynamic in interface JsonObjectMapping

setDynamic

public void setDynamic(boolean dynamic)
Specified by:
setDynamic in interface JsonObjectMapping

getDynamicNaming

public Naming getDynamicNaming()
Specified by:
getDynamicNaming in interface JsonObjectMapping

setDynamicNaming

public void setDynamicNaming(Naming dynamicNaming)
Specified by:
setDynamicNaming in interface JsonObjectMapping

addMapping

public int addMapping(Mapping mapping)
Description copied from class: AbstractResourceMapping
No duplicate names are allowed when added an id (applies the property names)

Specified by:
addMapping in interface InternalMultipleMapping
Overrides:
addMapping in class AbstractResourceMapping
Parameters:
mapping - The mapping to add
Returns:
The location the mapping was added to.

doPostProcess

protected void doPostProcess()
                      throws MappingException
Specified by:
doPostProcess in class AbstractResourceMapping
Throws:
MappingException

getResourcePropertyMappings

public ResourcePropertyMapping[] getResourcePropertyMappings()
Description copied from interface: ResourceMapping
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).

Specified by:
getResourcePropertyMappings in interface ResourceMapping

getResourcePropertyMappingByDotPath

public ResourcePropertyMapping getResourcePropertyMappingByDotPath(String path)
Description copied from interface: ResourceMapping
Returns the ResourcePropertyMapping that match the given path "dot" path (a.bValue.value), or null if none exists.

Specified by:
getResourcePropertyMappingByDotPath in interface ResourceMapping

getContentMapping

public JsonContentMapping getContentMapping()


Copyright (c) 2004-2009 The Compass Project.