codec.asn1
Class ClassInstanceResolver

java.lang.Object
  |
  +--codec.asn1.ClassInstanceResolver
All Implemented Interfaces:
Resolver

public class ClassInstanceResolver
extends Object
implements Resolver

Resolves requests for instances based on a class object. New instances are generated by invoking newInstance() on the wrapped class object. The class must provide a no-arg default constructor.

Version:
"$Id: ClassInstanceResolver.java,v 1.2 2000/12/06 17:47:27 vroth Exp $"
Author:
Volker Roth

Constructor Summary
ClassInstanceResolver(Class factory)
          Creates an instance with the given factory class.
 
Method Summary
 Class getFactoryClass()
          Returns the class object of the factory class.
 ASN1Type resolve(ASN1Type caller)
          Resolves the call by returning a new instance of the the factory class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassInstanceResolver

public ClassInstanceResolver(Class factory)
Creates an instance with the given factory class.
Parameters:
factory - The factory class.
Throws:
IllegalArgumentException - if factory has no default constructor, or does not implement ASN1Type.
Method Detail

getFactoryClass

public Class getFactoryClass()
Returns the class object of the factory class.
Returns:
The class object.

resolve

public ASN1Type resolve(ASN1Type caller)
                 throws ResolverException
Resolves the call by returning a new instance of the the factory class. The factory class must have been specified at the time of constructing this instance.
Specified by:
resolve in interface Resolver
Parameters:
caller - The caller. The caller is ignored.
Throws:
ResolverException - if for some reason the call cannot be resolved.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.