Author: jcarman
Date: Thu Feb 21 10:50:52 2008
New Revision: 629930
URL: http://svn.apache.org/viewvc?rev=629930&view=rev
Log:
Added javadocs
Modified:
commons/proper/proxy/branches/proxy-1.0-work/src/main/java/org/apache/commons/proxy/factory/javassist/JavassistUtils.java
Modified:
commons/proper/proxy/branches/proxy-1.0-work/src/main/java/org/apache/commons/proxy/factory/javassist/JavassistUtils.java
URL:
http://svn.apache.org/viewvc/commons/proper/proxy/branches/proxy-1.0-work/src/main/java/org/apache/commons/proxy/factory/javassist/JavassistUtils.java?rev=629930&r1=629929&r2=629930&view=diff
==============================================================================
---
commons/proper/proxy/branches/proxy-1.0-work/src/main/java/org/apache/commons/proxy/factory/javassist/JavassistUtils.java
(original)
+++
commons/proper/proxy/branches/proxy-1.0-work/src/main/java/org/apache/commons/proxy/factory/javassist/JavassistUtils.java
Thu Feb 21 10:50:52 2008
@@ -30,6 +30,8 @@
import java.util.Set;
/**
+ * Some utility methods for dealing with Javassist.
+ *
* @author James Carman
* @since 1.0
*/
@@ -52,12 +54,26 @@
// Static Methods
//----------------------------------------------------------------------------------------------------------------------
+ /**
+ * Adds a field to a class.
+ *
+ * @param fieldType the field's type
+ * @param fieldName the field name
+ * @param enclosingClass the class receiving the new field
+ * @throws CannotCompileException if a compilation problem occurs
+ */
public static void addField( Class fieldType, String fieldName, CtClass
enclosingClass )
throws CannotCompileException
{
enclosingClass.addField( new CtField( resolve( fieldType ), fieldName,
enclosingClass ) );
}
+ /**
+ * Finds the [EMAIL PROTECTED] CtClass} corresponding to the Java [EMAIL
PROTECTED] Class} passed in.
+ *
+ * @param clazz the Java [EMAIL PROTECTED] Class}
+ * @return the [EMAIL PROTECTED] CtClass}
+ */
public static CtClass resolve( Class clazz )
{
synchronized( classLoaders )
@@ -80,6 +96,12 @@
}
}
+ /**
+ * Adds interfaces to a [EMAIL PROTECTED] CtClass}
+ *
+ * @param ctClass the [EMAIL PROTECTED] CtClass}
+ * @param proxyClasses the interfaces
+ */
public static void addInterfaces( CtClass ctClass, Class[] proxyClasses )
{
for( int i = 0; i < proxyClasses.length; i++ )
@@ -89,16 +111,35 @@
}
}
+ /**
+ * Creates a new [EMAIL PROTECTED] CtClass} derived from the Java [EMAIL
PROTECTED] Class} using the default base name.
+ *
+ * @param superclass the superclass
+ * @return the new derived [EMAIL PROTECTED] CtClass}
+ */
public static CtClass createClass( Class superclass )
{
return createClass( DEFAULT_BASE_NAME, superclass );
}
+ /**
+ * Creates a new [EMAIL PROTECTED] CtClass} derived from the Java [EMAIL
PROTECTED] Class} using the supplied base name.
+ *
+ * @param baseName the base name
+ * @param superclass the superclass
+ * @return the new derived [EMAIL PROTECTED] CtClass}
+ */
public synchronized static CtClass createClass( String baseName, Class
superclass )
{
return classPool.makeClass( baseName + "_" + classNumber++, resolve(
superclass ) );
}
+ /**
+ * Resolves an array of Java [EMAIL PROTECTED] Class}es to an array of
their corresponding [EMAIL PROTECTED] CtClass}es.
+ *
+ * @param classes the Java [EMAIL PROTECTED] Class}es
+ * @return the corresponding [EMAIL PROTECTED] CtClass}es
+ */
public static CtClass[] resolve( Class[] classes )
{
final CtClass[] ctClasses = new CtClass[classes.length];