Errai 3.0.1-SNAPSHOT

org.jboss.errai.marshalling.rebind
Interface DefinitionsFactory

All Known Implementing Classes:
DefinitionsFactoryImpl

public interface DefinitionsFactory

The definitions factory is responsible for loading / registering mapping definitions for entities that will be marshalled.

Author:
Mike Brock

Method Summary
 void addDefinition(MappingDefinition definition)
          Registers a mapping definition with the factory
 Set<MetaClass> getArraySignatures()
           
 MappingDefinition getDefinition(Class<?> clazz)
          Returns a definition for the sepcified Class reference.
 MappingDefinition getDefinition(MetaClass clazz)
          Returns a definition for the specified MetaClass reference.
 MappingDefinition getDefinition(String clazz)
          Returns a definition for the fully-qualified class name provided.
 Set<MetaClass> getExposedClasses()
          Returns a set of all exposed classes.
 Map<String,String> getMappingAliases()
          Returns a map of aliases mappers.
 Collection<MappingDefinition> getMappingDefinitions()
          Returns a collection of all registered mapping definitions.
 boolean hasBuiltInDefinition(MetaClass type)
           
 boolean hasDefinition(Class<?> clazz)
          Return true if a definition is registered for the specified Class reference.
 boolean hasDefinition(MetaClass clazz)
          Return true if a definition is registered for the specified MetaClass
 boolean hasDefinition(String clazz)
          Returns true if a definition is registered matching fully-qualified class name provided.
 boolean isExposedClass(MetaClass clazz)
          Returns true if the class is exposed for marshalling.
 void mergeDefinition(MappingDefinition def)
          Merge the specified definition with any existing definitions in the specified definitions class hierarchy.
 void resetDefinitionsAndReload()
           
 boolean shouldUseObjectMarshaller(MetaClass type)
          Returns true if the marshalling system should treat the given type as polymorphic.
 

Method Detail

hasDefinition

boolean hasDefinition(String clazz)
Returns true if a definition is registered matching fully-qualified class name provided. If this DefinitionsFactory has a definition for , that means it can marshall and demarshall instances of clazz.

Parameters:
clazz - fully qualified class name.
Returns:
boolean true if defined.

hasDefinition

boolean hasDefinition(MetaClass clazz)
Return true if a definition is registered for the specified MetaClass

Parameters:
clazz - class reference
Returns:
boolean true if defined.

hasDefinition

boolean hasDefinition(Class<?> clazz)
Return true if a definition is registered for the specified Class reference.

Parameters:
clazz - class reference.
Returns:
boolean true if defined.

addDefinition

void addDefinition(MappingDefinition definition)
Registers a mapping definition with the factory

Parameters:
definition - a mapping definition

getDefinition

MappingDefinition getDefinition(String clazz)
Returns a definition for the fully-qualified class name provided.

Parameters:
clazz - fully qualified class name.
Returns:
an instance of the mapping definition, if defined. returns null if not defined.

getDefinition

MappingDefinition getDefinition(MetaClass clazz)
Returns a definition for the specified MetaClass reference.

Parameters:
clazz - class reference
Returns:
an instance of the mapping definition, if defined. returns null if not defined.

getDefinition

MappingDefinition getDefinition(Class<?> clazz)
Returns a definition for the sepcified Class reference.

Parameters:
clazz - class reference
Returns:
an instance of the mapping definition, if defined. returns null if not defined.

mergeDefinition

void mergeDefinition(MappingDefinition def)
Merge the specified definition with any existing definitions in the specified definitions class hierarchy. In general, if a mapping exists for the parent class of the specified definition, then its mappings will be merged in -- if they're not covered by the specified mapping. Overloaded constructor mappings will be detected, if the specified mapping does not define a constructor mapping.

Parameters:
def - a mapping definition to merge.

isExposedClass

boolean isExposedClass(MetaClass clazz)
Returns true if the class is exposed for marshalling. This is not the same as whether or not it has a defined definition.Just that the class is expected to be marshallable.

Parameters:
clazz - fully qualified class name.
Returns:
boolean true if exposed.

getExposedClasses

Set<MetaClass> getExposedClasses()
Returns a set of all exposed classes.

Returns:
a set of exposed classes.

getMappingAliases

Map<String,String> getMappingAliases()
Returns a map of aliases mappers. The keys represent the aliases and values represent the concrete mapping classes to use as a basis.

Returns:
a map of aliases.

shouldUseObjectMarshaller

boolean shouldUseObjectMarshaller(MetaClass type)
Returns true if the marshalling system should treat the given type as polymorphic.

Parameters:
type - The type to test for the existence of portable implementation/subtypes.

getMappingDefinitions

Collection<MappingDefinition> getMappingDefinitions()
Returns a collection of all registered mapping definitions.


resetDefinitionsAndReload

void resetDefinitionsAndReload()

getArraySignatures

Set<MetaClass> getArraySignatures()

hasBuiltInDefinition

boolean hasBuiltInDefinition(MetaClass type)

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.