[jboss-cvs] JBossAS SVN: r85895 - projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Mar 16 07:35:01 EDT 2009


Author: stalep
Date: 2009-03-16 07:35:01 -0400 (Mon, 16 Mar 2009)
New Revision: 85895

Added:
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/AbstractJavassistBody.java
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/Body.java
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/CannotCompileException.java
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/DefaultJavassistBody.java
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/InsertAfterJavassistBody.java
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/InsertBeforeJavassistBody.java
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableClassInfo.java
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableConstructorInfo.java
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableMethodInfo.java
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableMethodInfoCommand.java
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/NotFoundException.java
Log:
[JBREFLECT-49]
First version of MutableInterfaces. The design isnt finalized yet, so
expect many changes to come.

Added: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/AbstractJavassistBody.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/AbstractJavassistBody.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/AbstractJavassistBody.java	2009-03-16 11:35:01 UTC (rev 85895)
@@ -0,0 +1,47 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.reflect.spi;
+
+import javassist.CtBehavior;;
+
+/**
+ * A AbstractJavassistBody.
+ * 
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractJavassistBody implements Body
+{
+   String body;
+
+   AbstractJavassistBody(String body)
+   {
+      this.body = body;
+   }
+   public String getBody()
+   {
+      return body;
+   }
+   
+   abstract void createBody(CtBehavior behaviour);
+   
+}

Added: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/Body.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/Body.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/Body.java	2009-03-16 11:35:01 UTC (rev 85895)
@@ -0,0 +1,33 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.reflect.spi;
+
+/**
+ * A Metod or Constructor Body.
+ * 
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public interface Body
+{
+   String getBody();
+}

Added: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/CannotCompileException.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/CannotCompileException.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/CannotCompileException.java	2009-03-16 11:35:01 UTC (rev 85895)
@@ -0,0 +1,40 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.reflect.spi;
+
+/**
+ * A CannotCompileException.
+ * 
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class CannotCompileException extends RuntimeException
+{
+
+   /** The serialVersionUID */
+   private static final long serialVersionUID = -3034352186071876723L;
+
+   public CannotCompileException(String msg)
+   {
+      super(msg);
+   }
+}

Added: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/DefaultJavassistBody.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/DefaultJavassistBody.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/DefaultJavassistBody.java	2009-03-16 11:35:01 UTC (rev 85895)
@@ -0,0 +1,53 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.reflect.spi;
+
+import javassist.CannotCompileException;
+import javassist.CtBehavior;
+
+/**
+ * A DefaultJavassistBody.
+ * 
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class DefaultJavassistBody extends AbstractJavassistBody
+{
+   DefaultJavassistBody(String body)
+   {
+      super(body);
+   }
+
+   @Override
+   void createBody(CtBehavior behavior)
+   {
+      try
+      {
+         behavior.setBody(getBody());
+      }
+      catch (CannotCompileException e)
+      {
+         throw new org.jboss.reflect.spi.CannotCompileException(e.getMessage());
+      }
+   }
+
+}

Added: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/InsertAfterJavassistBody.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/InsertAfterJavassistBody.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/InsertAfterJavassistBody.java	2009-03-16 11:35:01 UTC (rev 85895)
@@ -0,0 +1,54 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.reflect.spi;
+
+import javassist.CannotCompileException;
+import javassist.CtBehavior;
+
+/**
+ * A InsertAfterJavassistBody.
+ * 
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class InsertAfterJavassistBody extends AbstractJavassistBody
+{
+
+   public InsertAfterJavassistBody(String body)
+   {
+      super(body);
+   }
+   
+   @Override
+   void createBody(CtBehavior behavior)
+   {
+      try
+      {
+         behavior.insertAfter(getBody());
+      }
+      catch (CannotCompileException e)
+      {
+         throw new org.jboss.reflect.spi.CannotCompileException(e.getMessage());
+      }
+   }
+
+}

Added: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/InsertBeforeJavassistBody.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/InsertBeforeJavassistBody.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/InsertBeforeJavassistBody.java	2009-03-16 11:35:01 UTC (rev 85895)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.reflect.spi;
+
+import javassist.CannotCompileException;
+import javassist.CtBehavior;
+
+/**
+ * A InsertBeforeJavassistBody.
+ * 
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class InsertBeforeJavassistBody extends AbstractJavassistBody
+{
+
+   public InsertBeforeJavassistBody(String body)
+   {
+      super(body);
+   }
+   @Override
+   void createBody(CtBehavior behavior)
+   {
+      try
+      {
+         behavior.insertBefore(getBody());
+      }
+      catch (CannotCompileException e)
+      {
+         throw new org.jboss.reflect.spi.CannotCompileException(e.getMessage());
+      }
+   }
+
+}

Added: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableClassInfo.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableClassInfo.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableClassInfo.java	2009-03-16 11:35:01 UTC (rev 85895)
@@ -0,0 +1,191 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.reflect.spi;
+
+/**
+ * A MutableClassInfo.
+ * 
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MutableClassInfo extends ClassInfo
+{
+   
+   /**
+    * Compiles the code included in Body and returns a MutableMethodInfo representation of it.
+    * The Body must include the whole declaration of the method.
+    * 
+    * @param body
+    * @return
+    */
+   MutableMethodInfo createMutableMethod(Body body);
+   
+   /**
+    * Compiles an empty method with the signature given by the params.
+    * 
+    * @param modifier
+    * @param name
+    * @param parameters
+    * @param exceptions
+    * @return
+    */
+   MutableMethodInfo createMutableMethod(ModifierInfo modifier, String name, 
+         String[] parameters, String[] exceptions);
+   
+   /**
+    * Compiles an empty method with the signature given by the params.
+    * 
+    * @param modifier
+    * @param name
+    * @param parameters
+    * @param exceptions
+    * @return
+    */
+   MutableMethodInfo createMutableMethod(ModifierInfo modifier, String name, 
+         MutableClassInfo[] parameters, MutableClassInfo[] exceptions);
+   
+   
+   /**
+    * Compile a method with the signature and body given by the params.
+    * Note that the source code of the body must be surrounded by <code>{}</code>.
+    * 
+    * @param modifier
+    * @param name
+    * @param body
+    * @param parameters
+    * @param exceptions
+    * @return
+    */
+   MutableMethodInfo createMutableMethod(ModifierInfo modifier, String name, Body body, 
+         String[] parameters, String[] exceptions);
+
+ 
+   /**
+    * Compile a method with the signature and body given by the params.
+    * Note that the source code of the body must be surrounded by <code>{}</code>.
+    * 
+    * @param modifier
+    * @param name
+    * @param body
+    * @param parameters
+    * @param exceptions
+    * @return
+    */
+   MutableMethodInfo createMutableMethod(ModifierInfo modifier, String name, Body body,
+         MutableClassInfo[] parameters, MutableClassInfo[] exceptions);
+
+   
+   /**
+    * Compiles the code included in the Body parameter and returns a MutableConstructorInfo
+    * representation of it. The Body must include the whole declaration.
+    * The 
+    * 
+    * @param body
+    * @return
+    */
+   MutableConstructorInfo createMutableConstructor(Body body);
+   
+   /**
+    * Creates an emptry constructor with params given.
+    * 
+    * @param modifier
+    * @param parameters
+    * @param exceptions
+    * @return
+    */
+   MutableConstructorInfo createMutableConstructor(ModifierInfo modifier, String[] parameters, 
+         String[] exceptions);
+   
+   /**
+    * Creates an emptry constructor with params given.
+    * 
+    * @param modifier
+    * @param parameters
+    * @param exceptions
+    * @return
+    */
+   MutableConstructorInfo createMutableConstructor(ModifierInfo modifier, MutableClassInfo[] parameters, 
+         MutableClassInfo[] exceptions);
+   
+   /**
+    * Create a constructor with the params given.
+    * Note that the source text of the Body must be surrounded by <code>{}</code>.
+    * 
+    * @param modifier
+    * @param body
+    * @param parameters
+    * @param exceptions
+    * @return
+    */
+   MutableConstructorInfo createMutableConstructor(ModifierInfo modifier, Body body,
+         String[] parameters, String[] exceptions);
+   
+   /**
+    * Create a constructor with the params given.
+    * Note that the source text of the Body must be surrounded by <code>{}</code>.
+    * 
+    * @param modifier
+    * @param body
+    * @param parameters
+    * @param exceptions
+    * @return
+    */
+   MutableConstructorInfo createMutableConstructor(ModifierInfo modifier, Body body,
+         MutableClassInfo[] parameters, MutableClassInfo[] exceptions);
+   
+   /**
+    * Add a method
+    * 
+    * @param mmi
+    */
+   void addMethod(MutableMethodInfo mmi);
+   
+   /**
+    * Remove the specified method from this class
+    * 
+    * @param mmi
+    */
+   void removeMethod(MutableMethodInfo mmi);
+   
+   /**
+    * Add a constructor
+    * 
+    * @param mci
+    */
+   void addConstructor(MutableConstructorInfo mci);
+   
+   /**
+    * Remove the specified constructor from this class
+    * 
+    * @param mci
+    */
+   void removeConstructor(MutableConstructorInfo mci);
+   
+   /**
+    * Converts the class to a Class file. 
+    * After this method is called, no modifications to the class is allowed.
+    * 
+    * @return
+    */
+   byte[] toByteCode();
+   
+}

Added: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableConstructorInfo.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableConstructorInfo.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableConstructorInfo.java	2009-03-16 11:35:01 UTC (rev 85895)
@@ -0,0 +1,75 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.reflect.spi;
+
+/**
+ * A MutableConstructorInfo.
+ * 
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MutableConstructorInfo extends ConstructorInfo
+{
+   /**
+    * Set modifier
+    * If not set it will default to public (non-static)
+    * 
+    * @param mi
+    */
+   void setModifier(ModifierInfo mi);
+   
+   /**
+    * The source text of the method body
+    * 
+    * @param body
+    */
+   void setBody(Body body);
+   
+   /**
+    * A list of the parameter types
+    * 
+    * @param parameters
+    */
+   void setParameters(String[] parameters);
+  
+   /**
+    * A list of the parameter types
+    * 
+    * @param parameters
+    */
+   void setParameters(MutableClassInfo[] parameters);
+   
+   /**
+    * A list of the exception types
+    * 
+    * @param exceptions
+    */
+   void setExceptions(String[] exceptions);
+   
+   /**
+    * A list of the exception types
+    * 
+    * @param exceptions
+    */
+   void setExceptions(MutableClassInfo[] exceptions);
+ 
+}

Added: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableMethodInfo.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableMethodInfo.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableMethodInfo.java	2009-03-16 11:35:01 UTC (rev 85895)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.reflect.spi;
+
+/**
+ * A MutableMethod Info.
+ * 
+ * @author <a href="mailto:stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MutableMethodInfo extends MethodInfo
+{
+
+   /**
+    * Set modifier
+    * If not set it will default to public (non-static)
+    * 
+    * @param mi
+    */
+   void setModifier(ModifierInfo mi);
+
+   /**
+    * Set type of the returned value
+    * 
+    * @param returnType
+    */
+   void setReturnType(String returnType);
+   
+   /**
+    * Set type of the returned value
+    * 
+    * @param returnType
+    */
+   void setReturnType(MutableClassInfo returnType);
+   
+   /**
+    * Method name
+    * 
+    * @param name
+    */
+   void setName(String name);
+   
+   /**
+    * The source text of the method body
+    * 
+    * @param body
+    */
+   void setBody(Body body);
+   
+   /**
+    * A list of the parameter types
+    * 
+    * @param parameters
+    */
+   void setParameters(String[] parameters);
+   
+   /**
+    * A list of the parameter types
+    * 
+    * @param parameters
+    */
+   void setParameters(MutableClassInfo[] parameters);
+   
+   /**
+    * A list of the exception types
+    * 
+    * @param exceptions
+    */
+   void setExceptions(String[] exceptions);
+   
+   /**
+    * A list of the exception types
+    * 
+    * @param exceptions
+    */
+   void setExceptions(MutableClassInfo[] exceptions);
+  
+   /**
+    * TODO: something similar to CtBehavior.instrument(...)
+    * 
+    * @param mmc
+    */
+   void executeCommand(MutableMethodInfoCommand mmc);
+}

Added: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableMethodInfoCommand.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableMethodInfoCommand.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/MutableMethodInfoCommand.java	2009-03-16 11:35:01 UTC (rev 85895)
@@ -0,0 +1,35 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.reflect.spi;
+
+/**
+ * A MutableMethodInfoCommand.
+ * TODO: see CtBehavior.instrument(...)
+ * 
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MutableMethodInfoCommand
+{
+
+   
+}

Added: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/NotFoundException.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/NotFoundException.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/NotFoundException.java	2009-03-16 11:35:01 UTC (rev 85895)
@@ -0,0 +1,36 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.reflect.spi;
+
+/**
+ * A NotFoundException.
+ * 
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class NotFoundException extends Exception
+{
+
+   /** The serialVersionUID */
+   private static final long serialVersionUID = -4143477618552256445L;
+
+}




More information about the jboss-cvs-commits mailing list