Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source.
   * Copyright 2014 Red Hat, Inc., and individual contributors
   * as indicated by the @author tags.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.jboss.marshalling;
 
A class annotator and resolver. Instances of this interface have the opportunity to append information (such as classloader information, or class bytes) to a written class descriptor. This information can then be used on unmarshalling to aid in the selection (or creation) of the proper Class based on the class descriptor and the annotation data.
 
 public interface ClassResolver {
    
Add optional information about a class to a stream. The class descriptor will already have been written.

Parameters:
marshaller the marshaller to write to
clazz the class that was written
Throws:
java.io.IOException if an error occurs
See also:
java.io.ObjectOutputStream.annotateClass(java.lang.Class)
 
     void annotateClass(Marshaller marshallerClass<?> clazzthrows IOException;

    
Add optional information about a proxy class to a stream. The class descriptor will already have been written.

Parameters:
marshaller the marshaller to write to
proxyClass the class that was written
Throws:
java.io.IOException if an error occurs
See also:
java.io.ObjectOutputStream.annotateProxyClass(java.lang.Class)
 
     void annotateProxyClass(Marshaller marshallerClass<?> proxyClassthrows IOException;

    
Get the class name to write for a given class. The class name will be written as part of the class descriptor.

Parameters:
clazz the class
Returns:
the class name
Throws:
java.io.IOException if an error occurs
 
     String getClassName(Class<?> clazzthrows IOException;

    
Get the interface names to write for a given proxy class. The interface names will be written as part of the class descriptor.

Parameters:
proxyClass the proxy class
Returns:
the proxy class interface names
Throws:
java.io.IOException if an error occurs
 
     String[] getProxyInterfaces(Class<?> proxyClassthrows IOException;

    
Load the local class for a class descriptor. The class descriptor has already been read, but any data written by annotateClass(org.jboss.marshalling.Marshaller,java.lang.Class) should be read by this method.

Parameters:
unmarshaller the unmarshaller from which to read annotation data, if any
name the class name
serialVersionUID the serial version UID
Returns:
the corresponding class
Throws:
java.io.IOException if an I/O error occurs
java.lang.ClassNotFoundException if the class could not be loaded
See also:
java.io.ObjectInputStream.resolveClass(java.io.ObjectStreamClass)
 
     Class<?> resolveClass(Unmarshaller unmarshallerString namelong serialVersionUIDthrows IOExceptionClassNotFoundException;

    
Load a proxy class that implements the given interfaces.

Parameters:
unmarshaller the unmarshaller from which to read annotation data, if any
interfaces the class descriptor
Returns:
the proxy class
Throws:
java.io.IOException if an I/O error occurs
java.lang.ClassNotFoundException if the proxy class could not be loaded
See also:
java.io.ObjectInputStream.resolveProxyClass(java.lang.String[])
    Class<?> resolveProxyClass(Unmarshaller unmarshallerString[] interfacesthrows IOExceptionClassNotFoundException;
New to GrepCode? Check out our FAQ X