JBoss Marshalling 1.3.0.CR9

org.jboss.marshalling
Class ChainingClassExternalizerFactory

java.lang.Object
  extended by org.jboss.marshalling.ChainingClassExternalizerFactory
All Implemented Interfaces:
ClassExternalizerFactory

public class ChainingClassExternalizerFactory
extends Object
implements ClassExternalizerFactory

A class externalizer factory that tries each delegate externalizer factory in sequence, returning the first match.


Constructor Summary
ChainingClassExternalizerFactory(ClassExternalizerFactory[] factories)
          Construct a new instance.
ChainingClassExternalizerFactory(Collection<ClassExternalizerFactory> factories)
          Construct a new instance.
ChainingClassExternalizerFactory(Iterable<ClassExternalizerFactory> factories)
          Construct a new instance.
ChainingClassExternalizerFactory(Iterator<ClassExternalizerFactory> factories)
          Construct a new instance.
 
Method Summary
 Externalizer getExternalizer(Class<?> type)
          Look up a custom externalizer for a given object class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainingClassExternalizerFactory

public ChainingClassExternalizerFactory(Collection<ClassExternalizerFactory> factories)
Construct a new instance.

Parameters:
factories - a collection of factories to use

ChainingClassExternalizerFactory

public ChainingClassExternalizerFactory(Iterable<ClassExternalizerFactory> factories)
Construct a new instance.

Parameters:
factories - a collection of factories to use

ChainingClassExternalizerFactory

public ChainingClassExternalizerFactory(Iterator<ClassExternalizerFactory> factories)
Construct a new instance.

Parameters:
factories - a sequence of factories to use

ChainingClassExternalizerFactory

public ChainingClassExternalizerFactory(ClassExternalizerFactory[] factories)
Construct a new instance.

Parameters:
factories - an array of factories to use
Method Detail

getExternalizer

public Externalizer getExternalizer(Class<?> type)
Look up a custom externalizer for a given object class. If no such externalizer exists, returns null. This implementation tries each nested externalizer factory in order until a match is found.

Specified by:
getExternalizer in interface ClassExternalizerFactory
Parameters:
type - the type to be externalized
Returns:
the externalizer, or null if there is none

JBoss Marshalling 1.3.0.CR9

Copyright © 2011 JBoss, a division of Red Hat, Inc.