org.apache.cayenne.enhancer
Class EnhancementHelper

java.lang.Object
  extended by org.apache.cayenne.enhancer.EnhancementHelper

public class EnhancementHelper
extends Object

A helper for the ASM ClassVisitor that encapsulates common class enhancement operations.

Since:
3.0

Constructor Summary
EnhancementHelper(ClassVisitor classVisitor)
           
 
Method Summary
 String[] addInterface(String[] interfaces, Class<?> newInterface)
          Appends an interface to a String array of interfaces, returning the resulting expanded array.
 void createField(Class<?> fieldType, String name)
          Creates a new protected field in the current class.
 void createField(Class<?> fieldType, String name, boolean isTransient)
          Creates a new protected field in the current class.
 void createProperty(Class<?> propertyType, String name)
           
 void createProperty(Class<?> propertyType, String name, boolean isTransient)
           
 Type getCurrentClass()
           
 String getPropertyField(String propertyName)
           
static boolean isGeneratedField(String name)
          Returns whether the field name matches the naming pattern of fields generated by Cayenne enhancer.
 void reset(String className)
          Resets helper to process a given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnhancementHelper

public EnhancementHelper(ClassVisitor classVisitor)
Method Detail

isGeneratedField

public static boolean isGeneratedField(String name)
Returns whether the field name matches the naming pattern of fields generated by Cayenne enhancer.


getCurrentClass

public Type getCurrentClass()

getPropertyField

public String getPropertyField(String propertyName)

reset

public void reset(String className)
Resets helper to process a given class. Must be called repeatedly before each class is processed.


addInterface

public String[] addInterface(String[] interfaces,
                             Class<?> newInterface)
Appends an interface to a String array of interfaces, returning the resulting expanded array.


createField

public void createField(Class<?> fieldType,
                        String name)
Creates a new protected field in the current class. Field name will be automatically prefixed by "$cay_".


createField

public void createField(Class<?> fieldType,
                        String name,
                        boolean isTransient)
Creates a new protected field in the current class. Field name will be automatically prefixed by "$cay_".


createProperty

public void createProperty(Class<?> propertyType,
                           String name)

createProperty

public void createProperty(Class<?> propertyType,
                           String name,
                           boolean isTransient)


Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.