org.openrdf.repository.object.composition
Class ClassTemplate

java.lang.Object
  extended by org.openrdf.repository.object.composition.ClassTemplate

public class ClassTemplate
extends Object

Class builder.

Author:
James Leigh

Constructor Summary
protected ClassTemplate(javassist.CtClass cc, ClassFactory cp)
           
 
Method Summary
 void addConstructor(Class<?>[] types, String string)
           
 void addInterface(Class<?> face)
           
 CodeBuilder assignStaticField(Class<?> type, String fieldName)
           
 void copyAnnotationsFrom(Class<?> c)
           
 CodeBuilder copyMethod(Method method, String name, boolean bridge)
           
 void createField(Class<?> type, String fieldName)
           
 CodeBuilder createMethod(Class<?> type, String name, Class<?>... parameters)
           
 CodeBuilder createPrivateMethod(Class<?> type, String name, Class<?>... parameters)
           
 CodeBuilder createTransientMethod(Method method)
           
 CodeBuilder getCodeBuilder()
           
 javassist.CtClass getCtClass()
           
 Set<String> getDeclaredFieldNames()
           
 Set<Field> getFieldsRead(Method method)
           
 Set<Field> getFieldsWritten(Method method)
           
 Class<?>[] getInterfaces()
           
 Class<?> getSuperclass()
           
 CodeBuilder overrideMethod(Method method, boolean bridge)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassTemplate

protected ClassTemplate(javassist.CtClass cc,
                        ClassFactory cp)
Method Detail

addConstructor

public void addConstructor(Class<?>[] types,
                           String string)
                    throws ObjectCompositionException
Throws:
ObjectCompositionException

toString

public String toString()
Overrides:
toString in class Object

addInterface

public void addInterface(Class<?> face)
                  throws ObjectCompositionException
Throws:
ObjectCompositionException

assignStaticField

public CodeBuilder assignStaticField(Class<?> type,
                                     String fieldName)
                              throws ObjectCompositionException
Throws:
ObjectCompositionException

createField

public void createField(Class<?> type,
                        String fieldName)
                 throws ObjectCompositionException
Throws:
ObjectCompositionException

createMethod

public CodeBuilder createMethod(Class<?> type,
                                String name,
                                Class<?>... parameters)
                         throws ObjectCompositionException
Throws:
ObjectCompositionException

createPrivateMethod

public CodeBuilder createPrivateMethod(Class<?> type,
                                       String name,
                                       Class<?>... parameters)
                                throws ObjectCompositionException
Throws:
ObjectCompositionException

copyAnnotationsFrom

public void copyAnnotationsFrom(Class<?> c)

copyMethod

public CodeBuilder copyMethod(Method method,
                              String name,
                              boolean bridge)
                       throws ObjectCompositionException
Throws:
ObjectCompositionException

createTransientMethod

public CodeBuilder createTransientMethod(Method method)
                                  throws ObjectCompositionException
Throws:
ObjectCompositionException

getCodeBuilder

public CodeBuilder getCodeBuilder()

getCtClass

public javassist.CtClass getCtClass()

getDeclaredFieldNames

public Set<String> getDeclaredFieldNames()

getSuperclass

public Class<?> getSuperclass()

getInterfaces

public Class<?>[] getInterfaces()
                         throws ObjectCompositionException
Throws:
ObjectCompositionException

overrideMethod

public CodeBuilder overrideMethod(Method method,
                                  boolean bridge)
                           throws ObjectCompositionException
Throws:
ObjectCompositionException

getFieldsRead

public Set<Field> getFieldsRead(Method method)
                         throws javassist.NotFoundException
Throws:
javassist.NotFoundException

getFieldsWritten

public Set<Field> getFieldsWritten(Method method)
                            throws javassist.NotFoundException
Throws:
javassist.NotFoundException


Copyright © 2004-2009 James Leigh Services Inc.. All Rights Reserved.