Errai 3.0.1-SNAPSHOT

org.jboss.errai.marshalling.client.api
Interface MarshallingSession

All Known Implementing Classes:
AbstractMarshallingSession, DecodingSession, EncodingSession, MarshallerFramework.JSONMarshallingSession

public interface MarshallingSession

Author:
Mike Brock

Method Summary
 String determineTypeFor(String formatType, Object o)
           
 String getAssumedElementType()
           
 String getAssumedMapKeyType()
           
 String getAssumedMapValueType()
           
 MappingContext getMappingContext()
           
 Marshaller<Object> getMarshallerInstance(String fqcn)
          Returns a marshaller for the provided type.
<T> T
getObject(Class<T> type, String hashCode)
          Looks up the object based on the specified hashCode identifier.
 String getObject(Object reference)
          Returns a unique identifier for the specified object reference.
 boolean hasObject(Object reference)
          Checks if the object is already in the context based on the object reference.
 boolean hasObject(String hashCode)
          Checks if the object is already in the context based on the hash code.
<T> T
recordObject(String hashCode, T instance)
          Records a new object to the session with the specified hashCode identifier.
 void resetAssumedTypes()
           
 void setAssumedElementType(String assumedElementType)
           
 void setAssumedMapKeyType(String assumedMapKeyType)
           
 void setAssumedMapValueType(String assumedMapValueType)
           
 

Method Detail

getMappingContext

MappingContext getMappingContext()

getMarshallerInstance

Marshaller<Object> getMarshallerInstance(String fqcn)
Returns a marshaller for the provided type.

Parameters:
fqcn - fully qualified class name of the type to be marshalled, in the format returned by Class.getName() and MetaClass.getFullyQualifiedName(). Null is permitted, and yields a marshaller that can only marshal and demarshal null references.
Returns:
marshaller instance, or null if no marshaller was found for the given type.

determineTypeFor

String determineTypeFor(String formatType,
                        Object o)

recordObject

<T> T recordObject(String hashCode,
                   T instance)
Records a new object to the session with the specified hashCode identifier.

Parameters:
hashCode - a unique identifier
instance - the instance of the entity.

hasObject

boolean hasObject(Object reference)
Checks if the object is already in the context based on the object reference.

Parameters:
reference - the entity reference
Returns:
true if the session contains the object reference.

hasObject

boolean hasObject(String hashCode)
Checks if the object is already in the context based on the hash code.

Parameters:
hashCode - the hash code
Returns:
true if the session contains the object reference.

getObject

String getObject(Object reference)
Returns a unique identifier for the specified object reference. Returns a new identifier if the object is unknown to the session, or returns the existing one if it is known.

Parameters:
reference - the entity reference
Returns:
a new or existing identifier within this session

getObject

<T> T getObject(Class<T> type,
                String hashCode)
Looks up the object based on the specified hashCode identifier. Returns null if the specified identifier does not exist.

Type Parameters:
T - the type of entity being looked up
Parameters:
type - the type of entity being looked up
hashCode - the identifier of the entity within the session
Returns:
the instance of the entity or null if not present

getAssumedElementType

String getAssumedElementType()

setAssumedElementType

void setAssumedElementType(String assumedElementType)

getAssumedMapKeyType

String getAssumedMapKeyType()

setAssumedMapKeyType

void setAssumedMapKeyType(String assumedMapKeyType)

getAssumedMapValueType

String getAssumedMapValueType()

setAssumedMapValueType

void setAssumedMapValueType(String assumedMapValueType)

resetAssumedTypes

void resetAssumedTypes()

Errai 3.0.1-SNAPSHOT

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