[seam-commits] Seam SVN: r13561 - in sandbox/encore/core/src: main/java/org/jboss/encore/grammar/java/ast and 4 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Thu Aug 5 13:54:52 EDT 2010
Author: lincolnthree
Date: 2010-08-05 13:54:51 -0400 (Thu, 05 Aug 2010)
New Revision: 13561
Added:
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Abstractable.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Field.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/VisibilityScoped.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/ast/AnnotationAccessor.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/FieldImpl.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/util/
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/util/Strings.java
sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/FieldAnnotationTest.java
sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/FieldTest.java
sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/JavaClassAnnotationTest.java
sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedClass.java
sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedField.java
sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedMethod.java
sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockClass.java
Removed:
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/AnnotationUtil.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/Strings.java
sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/ClassAnnotationTest.java
sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedClassFile.java
sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedMethodFile.java
sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockClassFile.java
Modified:
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/JavaClass.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Method.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/AnnotationImpl.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/JavaClassImpl.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/MethodImpl.java
sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/ValuePairImpl.java
sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/JavaClassTest.java
sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/MethodAnnotationTest.java
sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/MethodTest.java
Log:
Fields & Field Annotations are working - however, field addition is not.
Added: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Abstractable.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Abstractable.java (rev 0)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Abstractable.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * 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.encore.grammar.java;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public interface Abstractable<T>
+{
+ public abstract boolean isAbstract();
+
+ public abstract T setAbstract(boolean abstrct);
+}
Added: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Field.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Field.java (rev 0)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Field.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * 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.encore.grammar.java;
+
+import org.jboss.encore.grammar.Internal;
+import org.jboss.encore.grammar.Mutable;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public interface Field extends Mutable, Internal, VisibilityScoped<Field>, AnnotationTarget<Field>
+{
+
+}
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/JavaClass.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/JavaClass.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/JavaClass.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -31,9 +31,8 @@
* @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
*
*/
-public interface JavaClass extends Internal, Mutable, AnnotationTarget<JavaClass>
+public interface JavaClass extends Internal, Mutable, Abstractable<JavaClass>, VisibilityScoped<JavaClass>, AnnotationTarget<JavaClass>
{
-
/*
* Annotation modifiers
*/
@@ -51,22 +50,24 @@
public abstract JavaClass removeImport(Import imprt);
- /**
- * Get a list of the {@link Import}s contained within this {@link JavaClass}.
- * Note that modification of this list does not affect internal state, but
- * modification of individual {@link Import} objects will.
- */
public abstract List<Import> getImports();
+ /*
+ * Fields & Methods
+ */
+
+ public abstract Field addField();
+
+ public abstract Field addField(final String field);
+
+ public abstract List<Field> getFields();
+
+ public abstract JavaClass removeField(final Field method);
+
public abstract Method addMethod();
public abstract Method addMethod(final String method);
- /**
- * Get a list of the {@link Method}s contained within this {@link JavaClass}.
- * Note that modification of this list does not affect internal state, but
- * modification of individual {@link Method} objects will.
- */
public abstract List<Method> getMethods();
public abstract JavaClass removeMethod(final Method method);
@@ -83,29 +84,6 @@
public abstract boolean isDefaultPackage();
- /*
- * Visibility modifiers
- */
- public abstract boolean isPackagePrivate();
-
- public abstract JavaClass setPackagePrivate();
-
- public abstract boolean isPublic();
-
- public abstract JavaClass setPublic();
-
- public abstract boolean isPrivate();
-
- public abstract JavaClass setPrivate();
-
- public abstract boolean isProtected();
-
- public abstract JavaClass setProtected();
-
- public abstract boolean isAbstract();
-
- public abstract JavaClass setAbstract(boolean abstrct);
-
@Override
public abstract int hashCode();
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Method.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Method.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/Method.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -29,7 +29,7 @@
* @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
*
*/
-public interface Method extends Internal, Mutable, AnnotationTarget<Method>
+public interface Method extends Internal, Mutable, Abstractable<Method>, VisibilityScoped<Method>, AnnotationTarget<Method>
{
public String getBody();
@@ -44,32 +44,12 @@
public boolean isConstructor();
- public boolean isAbstract();
-
- public Method setAbstract(boolean abstrct);
-
public Method setFinal();
public String getName();
public Method setName(final String name);
- public boolean isPackagePrivate();
-
- public Method setPackagePrivate();
-
- public boolean isPublic();
-
- public Method setPublic();
-
- public boolean isPrivate();
-
- public Method setPrivate();
-
- public boolean isProtected();
-
- public Method setProtected();
-
public String getReturnType();
public Method setReturnType(final Class<?> type);
Added: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/VisibilityScoped.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/VisibilityScoped.java (rev 0)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/VisibilityScoped.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * 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.encore.grammar.java;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public interface VisibilityScoped<T>
+{
+ public abstract boolean isPackagePrivate();
+
+ public abstract T setPackagePrivate();
+
+ public abstract boolean isPublic();
+
+ public abstract T setPublic();
+
+ public abstract boolean isPrivate();
+
+ public abstract T setPrivate();
+
+ public abstract boolean isProtected();
+
+ public abstract T setProtected();
+}
Copied: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/ast/AnnotationAccessor.java (from rev 13560, sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/AnnotationUtil.java)
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/ast/AnnotationAccessor.java (rev 0)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/ast/AnnotationAccessor.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * 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.encore.grammar.java.ast;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.core.dom.BodyDeclaration;
+import org.jboss.encore.grammar.java.Annotation;
+import org.jboss.encore.grammar.java.AnnotationTarget;
+import org.jboss.encore.grammar.java.impl.AnnotationImpl;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public class AnnotationAccessor
+{
+
+ @SuppressWarnings("unchecked")
+ public Annotation addAnnotation(AnnotationTarget<?> target, BodyDeclaration body)
+ {
+ Annotation annotation = new AnnotationImpl(target);
+ body.modifiers().add(annotation.getInternal());
+ return annotation;
+ }
+
+ public Annotation addAnnotation(AnnotationTarget<?> target, BodyDeclaration body, Class<?> clazz)
+ {
+ return addAnnotation(target, body, clazz.getName());
+ }
+
+ public Annotation addAnnotation(AnnotationTarget<?> target, BodyDeclaration body, final String className)
+ {
+ return addAnnotation(target, body).setName(className);
+ }
+
+ public List<Annotation> getAnnotations(AnnotationTarget<?> target, BodyDeclaration body)
+ {
+ List<Annotation> result = new ArrayList<Annotation>();
+
+ List<?> modifiers = body.modifiers();
+ for (Object object : modifiers)
+ {
+ if (object instanceof org.eclipse.jdt.core.dom.Annotation)
+ {
+ Annotation annotation = new AnnotationImpl(target, object);
+ result.add(annotation);
+ }
+ }
+
+ return result;
+ }
+
+ public <T extends AnnotationTarget<?>> T removeAnnotation(T target, BodyDeclaration body, Annotation annotation)
+ {
+ List<?> modifiers = body.modifiers();
+ for (Object object : modifiers)
+ {
+ if (object.equals(annotation.getInternal()))
+ {
+ modifiers.remove(object);
+ break;
+ }
+ }
+ return target;
+ }
+}
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/AnnotationImpl.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/AnnotationImpl.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/AnnotationImpl.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -37,6 +37,7 @@
import org.jboss.encore.grammar.java.JavaClass;
import org.jboss.encore.grammar.java.JavaParser;
import org.jboss.encore.grammar.java.ValuePair;
+import org.jboss.encore.grammar.java.util.Strings;
/**
*
Deleted: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/AnnotationUtil.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/AnnotationUtil.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/AnnotationUtil.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * 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.encore.grammar.java.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.jboss.encore.grammar.java.Annotation;
-import org.jboss.encore.grammar.java.AnnotationTarget;
-
-/**
- * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
- *
- */
-public class AnnotationUtil
-{
-
- @SuppressWarnings("unchecked")
- public Annotation addAnnotation(AnnotationTarget<?> target, BodyDeclaration body)
- {
- Annotation annotation = new AnnotationImpl(target);
- body.modifiers().add(annotation.getInternal());
- return annotation;
- }
-
- public Annotation addAnnotation(AnnotationTarget<?> target, BodyDeclaration body, Class<?> clazz)
- {
- return addAnnotation(target, body, clazz.getName());
- }
-
- public Annotation addAnnotation(AnnotationTarget<?> target, BodyDeclaration body, final String className)
- {
- return addAnnotation(target, body).setName(className);
- }
-
- public List<Annotation> getAnnotations(AnnotationTarget<?> target, BodyDeclaration body)
- {
- List<Annotation> result = new ArrayList<Annotation>();
-
- List<?> modifiers = body.modifiers();
- for (Object object : modifiers)
- {
- if (object instanceof org.eclipse.jdt.core.dom.Annotation)
- {
- Annotation annotation = new AnnotationImpl(target, object);
- result.add(annotation);
- }
- }
-
- return result;
- }
-
- public <T extends AnnotationTarget<?>> T removeAnnotation(T target, BodyDeclaration body, Annotation annotation)
- {
- List<?> modifiers = body.modifiers();
- for (Object object : modifiers)
- {
- if (object.equals(annotation.getInternal()))
- {
- modifiers.remove(object);
- break;
- }
- }
- return target;
- }
-}
Added: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/FieldImpl.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/FieldImpl.java (rev 0)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/FieldImpl.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -0,0 +1,177 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * 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.encore.grammar.java.impl;
+
+import java.util.List;
+
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.jboss.encore.grammar.java.Annotation;
+import org.jboss.encore.grammar.java.Field;
+import org.jboss.encore.grammar.java.JavaClass;
+import org.jboss.encore.grammar.java.JavaParser;
+import org.jboss.encore.grammar.java.ast.AnnotationAccessor;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public class FieldImpl implements Field
+{
+ private static AnnotationAccessor util = new AnnotationAccessor();
+
+ private JavaClass parent;
+ private AST ast;
+ private final FieldDeclaration field;
+
+ private void init(final JavaClass parent)
+ {
+ this.parent = parent;
+ ast = ((ASTNode) parent.getInternal()).getAST();
+ }
+
+ public FieldImpl(JavaClass parent)
+ {
+ init(parent);
+ this.field = ast.newFieldDeclaration(ast.newVariableDeclarationFragment());
+ }
+
+ public FieldImpl(JavaClass parent, String declaration)
+ {
+ init(parent);
+
+ String stub = "public class Stub { " + declaration + " }";
+ JavaClass temp = JavaParser.parse(stub);
+ List<Field> fields = temp.getFields();
+ FieldDeclaration newField = (FieldDeclaration) fields.get(0).getInternal();
+ FieldDeclaration subtree = (FieldDeclaration) ASTNode.copySubtree(ast, newField);
+ this.field = subtree;
+ }
+
+ public FieldImpl(JavaClass parent, Object internal)
+ {
+ init(parent);
+ this.field = (FieldDeclaration) internal;
+ }
+
+ @Override
+ public void applyChanges()
+ {
+ parent.applyChanges();
+ }
+
+ @Override
+ public Object getInternal()
+ {
+ return field;
+ }
+
+ @Override
+ public boolean isPackagePrivate()
+ {
+ return false;
+ }
+
+ @Override
+ public Field setPackagePrivate()
+ {
+ return null;
+ }
+
+ @Override
+ public boolean isPublic()
+ {
+ return false;
+ }
+
+ @Override
+ public Field setPublic()
+ {
+ return null;
+ }
+
+ @Override
+ public boolean isPrivate()
+ {
+ return false;
+ }
+
+ @Override
+ public Field setPrivate()
+ {
+ return null;
+ }
+
+ @Override
+ public boolean isProtected()
+ {
+ return false;
+ }
+
+ @Override
+ public Field setProtected()
+ {
+ return null;
+ }
+
+ /*
+ * Annotation Modifiers
+ */
+ @Override
+ public Annotation addAnnotation()
+ {
+ return util.addAnnotation(this, field);
+ }
+
+ @Override
+ public Annotation addAnnotation(Class<?> clazz)
+ {
+ return util.addAnnotation(this, field, clazz);
+ }
+
+ @Override
+ public Annotation addAnnotation(final String className)
+ {
+ return util.addAnnotation(this, field, className);
+ }
+
+ @Override
+ public List<Annotation> getAnnotations()
+ {
+ return util.getAnnotations(this, field);
+ }
+
+ @Override
+ public Field removeAnnotation(Annotation annotation)
+ {
+ return util.removeAnnotation(this, field, annotation);
+ }
+
+ @Override
+ public String toString()
+ {
+ return field.toString();
+ }
+
+}
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/JavaClassImpl.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/JavaClassImpl.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/JavaClassImpl.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -28,6 +28,7 @@
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.FieldDeclaration;
import org.eclipse.jdt.core.dom.ImportDeclaration;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
@@ -39,9 +40,11 @@
import org.eclipse.text.edits.MalformedTreeException;
import org.eclipse.text.edits.TextEdit;
import org.jboss.encore.grammar.java.Annotation;
+import org.jboss.encore.grammar.java.Field;
import org.jboss.encore.grammar.java.Import;
import org.jboss.encore.grammar.java.JavaClass;
import org.jboss.encore.grammar.java.Method;
+import org.jboss.encore.grammar.java.ast.AnnotationAccessor;
import org.jboss.encore.grammar.java.ast.MethodFinderVisitor;
import org.jboss.encore.grammar.java.ast.ModifierAccessor;
import org.jboss.encore.grammar.java.ast.TypeDeclarationFinderVisitor;
@@ -53,7 +56,7 @@
*/
public class JavaClassImpl implements JavaClass
{
- private static AnnotationUtil util = new AnnotationUtil();
+ private static AnnotationAccessor util = new AnnotationAccessor();
private Document document;
private CompilationUnit unit;
@@ -222,11 +225,49 @@
}
/*
- * Method modifiers
+ * Field & Method modifiers
*/
@Override
@SuppressWarnings("unchecked")
+ public Field addField()
+ {
+ Field field = new FieldImpl(this);
+ getTypeDeclaration().bodyDeclarations().add(field.getInternal());
+ return field;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public Field addField(String declaration)
+ {
+ Field field = new FieldImpl(this, declaration);
+ getTypeDeclaration().bodyDeclarations().add(field.getInternal());
+ return field;
+ }
+
+ @Override
+ public List<Field> getFields()
+ {
+ List<Field> result = new ArrayList<Field>();
+
+ for (FieldDeclaration field : getTypeDeclaration().getFields())
+ {
+ result.add(new FieldImpl(this, field));
+ }
+
+ return result;
+ }
+
+ @Override
+ public JavaClass removeField(Field field)
+ {
+ getTypeDeclaration().bodyDeclarations().remove(field.getInternal());
+ return this;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
public Method addMethod()
{
Method m = new MethodImpl(this);
@@ -262,10 +303,7 @@
@Override
public JavaClass removeMethod(final Method method)
{
- if (getMethods().contains(method))
- {
- getTypeDeclaration().bodyDeclarations().remove(method.getInternal());
- }
+ getTypeDeclaration().bodyDeclarations().remove(method.getInternal());
return this;
}
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/MethodImpl.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/MethodImpl.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/MethodImpl.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -34,6 +34,7 @@
import org.jboss.encore.grammar.java.JavaClass;
import org.jboss.encore.grammar.java.JavaParser;
import org.jboss.encore.grammar.java.Method;
+import org.jboss.encore.grammar.java.ast.AnnotationAccessor;
import org.jboss.encore.grammar.java.ast.ModifierAccessor;
/**
@@ -42,7 +43,7 @@
*/
public class MethodImpl implements Method
{
- private static AnnotationUtil util = new AnnotationUtil();
+ private static AnnotationAccessor util = new AnnotationAccessor();
private JavaClass parent = null;
private AST ast = null;
@@ -82,6 +83,10 @@
this.method = subtree;
}
+ /*
+ * Annotation Modifiers
+ */
+
@Override
public Annotation addAnnotation()
{
@@ -112,6 +117,10 @@
return util.removeAnnotation(this, method, annotation);
}
+ /*
+ * Method Modifiers
+ */
+
@Override
@SuppressWarnings("unchecked")
public String getBody()
Deleted: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/Strings.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/Strings.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/Strings.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * 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.encore.grammar.java.impl;
-
-/**
- * String utilities.
- *
- * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
- *
- */
-public class Strings
-{
- public static String unquote(String value)
- {
- String result = null;
- if (value != null)
- {
- result = value.toString().replaceAll("\"(.*)\"", "$1");
- }
- return result;
- }
-}
Modified: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/ValuePairImpl.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/ValuePairImpl.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/ValuePairImpl.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -23,6 +23,7 @@
package org.jboss.encore.grammar.java.impl;
import org.jboss.encore.grammar.java.ValuePair;
+import org.jboss.encore.grammar.java.util.Strings;
/**
* Represents an annotation value pair
Copied: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/util/Strings.java (from rev 13560, sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/impl/Strings.java)
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/util/Strings.java (rev 0)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/util/Strings.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * 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.encore.grammar.java.util;
+
+/**
+ * String utilities.
+ *
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public class Strings
+{
+ public static String unquote(String value)
+ {
+ String result = null;
+ if (value != null)
+ {
+ result = value.toString().replaceAll("\"(.*)\"", "$1");
+ }
+ return result;
+ }
+}
Deleted: sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/ClassAnnotationTest.java
===================================================================
--- sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/ClassAnnotationTest.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/ClassAnnotationTest.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * 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.encore.grammar.java;
-
-import java.io.InputStream;
-
-/**
- * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
- */
-public class ClassAnnotationTest extends AnnotationTest
-{
- @Override
- public void resetTests()
- {
- InputStream stream = ClassAnnotationTest.class.getResourceAsStream("/org/jboss/encore/grammar/java/MockAnnotatedClassFile.java");
- JavaClass javaClass = JavaParser.parse(stream);
- setTarget(javaClass);
- }
-}
Added: sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/FieldAnnotationTest.java
===================================================================
--- sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/FieldAnnotationTest.java (rev 0)
+++ sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/FieldAnnotationTest.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * 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.encore.grammar.java;
+
+import java.io.InputStream;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ */
+public class FieldAnnotationTest extends AnnotationTest
+{
+ @Override
+ public void resetTests()
+ {
+ InputStream stream = FieldAnnotationTest.class.getResourceAsStream("/org/jboss/encore/grammar/java/MockAnnotatedField.java");
+ Field field = JavaParser.parse(stream).getFields().get(0);
+ setTarget(field);
+ }
+}
Added: sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/FieldTest.java
===================================================================
--- sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/FieldTest.java (rev 0)
+++ sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/FieldTest.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * 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.encore.grammar.java;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ */
+public class FieldTest
+{
+ private InputStream stream;
+ private JavaClass javaClass;
+ private Field field;
+
+ @Before
+ public void reset()
+ {
+ stream = FieldTest.class.getResourceAsStream("/org/jboss/encore/grammar/java/MockAnnotatedField.java");
+ javaClass = JavaParser.parse(stream);
+ javaClass.addField("public Boolean flag = false;");
+ field = javaClass.getFields().get(javaClass.getFields().size() - 1);
+ }
+
+ @Test
+ public void testParse() throws Exception
+ {
+ assertTrue(field instanceof Field);
+ }
+
+}
Copied: sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/JavaClassAnnotationTest.java (from rev 13560, sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/ClassAnnotationTest.java)
===================================================================
--- sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/JavaClassAnnotationTest.java (rev 0)
+++ sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/JavaClassAnnotationTest.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * 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.encore.grammar.java;
+
+import java.io.InputStream;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ */
+public class JavaClassAnnotationTest extends AnnotationTest
+{
+ @Override
+ public void resetTests()
+ {
+ InputStream stream = JavaClassAnnotationTest.class.getResourceAsStream("/org/jboss/encore/grammar/java/MockAnnotatedClass.java");
+ JavaClass javaClass = JavaParser.parse(stream);
+ setTarget(javaClass);
+ }
+}
Modified: sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/JavaClassTest.java
===================================================================
--- sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/JavaClassTest.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/JavaClassTest.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -45,22 +45,22 @@
@Before
public void reset()
{
- stream = JavaClassTest.class.getResourceAsStream("/org/jboss/encore/grammar/java/MockClassFile.java");
+ stream = JavaClassTest.class.getResourceAsStream("/org/jboss/encore/grammar/java/MockClass.java");
javaClass = JavaParser.parse(stream);
}
@Test
public void testApplyChangesRequiredForModification() throws Exception
{
- assertEquals("MockClassFile", javaClass.getName());
+ assertEquals("MockClass", javaClass.getName());
javaClass.setName("Telephone");
assertEquals("Telephone", javaClass.getName());
assertFalse(javaClass.toString().contains("Telephone"));
- assertTrue(javaClass.toString().contains("MockClassFile"));
+ assertTrue(javaClass.toString().contains("MockClass"));
javaClass.applyChanges();
assertTrue(javaClass.toString().contains("Telephone"));
- assertFalse(javaClass.toString().contains("MockClassFile"));
+ assertFalse(javaClass.toString().contains("MockClass"));
}
@Test
@@ -68,7 +68,7 @@
{
assertEquals(URL.class.getName(), javaClass.getImports().get(0).getName());
assertEquals(2, javaClass.getMethods().size());
- assertEquals("MockClassFile", javaClass.getName());
+ assertEquals("MockClass", javaClass.getName());
assertTrue(javaClass.isPublic());
assertFalse(javaClass.isAbstract());
}
@@ -76,7 +76,7 @@
@Test
public void testSetName() throws Exception
{
- assertEquals("MockClassFile", javaClass.getName());
+ assertEquals("MockClass", javaClass.getName());
javaClass.setName("Telephone");
assertEquals("Telephone", javaClass.getName());
}
@@ -84,8 +84,8 @@
@Test
public void testSetNameUpdatesConstructorNames() throws Exception
{
- assertEquals("MockClassFile", javaClass.getName());
- assertEquals("MockClassFile", javaClass.getMethods().get(0).getName());
+ assertEquals("MockClass", javaClass.getName());
+ assertEquals("MockClass", javaClass.getMethods().get(0).getName());
javaClass.setName("Telephone");
assertEquals("Telephone", javaClass.getName());
assertEquals("Telephone", javaClass.getMethods().get(0).getName());
Modified: sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/MethodAnnotationTest.java
===================================================================
--- sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/MethodAnnotationTest.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/MethodAnnotationTest.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -31,7 +31,7 @@
@Override
public void resetTests()
{
- InputStream stream = MethodAnnotationTest.class.getResourceAsStream("/org/jboss/encore/grammar/java/MockAnnotatedMethodFile.java");
+ InputStream stream = MethodAnnotationTest.class.getResourceAsStream("/org/jboss/encore/grammar/java/MockAnnotatedMethod.java");
Method method = JavaParser.parse(stream).getMethods().get(0);
setTarget(method);
}
Modified: sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/MethodTest.java
===================================================================
--- sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/MethodTest.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/MethodTest.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -42,7 +42,7 @@
@Before
public void reset()
{
- stream = MethodTest.class.getResourceAsStream("/org/jboss/encore/grammar/java/MockClassFile.java");
+ stream = MethodTest.class.getResourceAsStream("/org/jboss/encore/grammar/java/MockClass.java");
javaClass = JavaParser.parse(stream);
javaClass.addMethod("public URL rewriteURL(String pattern, String replacement) { return null; }");
method = javaClass.getMethods().get(javaClass.getMethods().size() - 1);
Copied: sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedClass.java (from rev 13560, sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedClassFile.java)
===================================================================
--- sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedClass.java (rev 0)
+++ sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedClass.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -0,0 +1,15 @@
+package org.jboss.seam.encore.grammar.java;
+
+import java.net.URL;
+
+ at Deprecated
+ at SuppressWarnings("deprecation")
+ at SuppressWarnings(value="unchecked")
+public class MockAnnotatedClass
+{
+ private String field;
+
+ public MockClassFile()
+ {
+ }
+}
Deleted: sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedClassFile.java
===================================================================
--- sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedClassFile.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedClassFile.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -1,15 +0,0 @@
-package org.jboss.seam.encore.grammar.java;
-
-import java.net.URL;
-
- at Deprecated
- at SuppressWarnings("deprecation")
- at SuppressWarnings(value="unchecked")
-public class MockAnnotatedClassFile
-{
- private String field;
-
- public MockClassFile()
- {
- }
-}
Added: sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedField.java
===================================================================
--- sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedField.java (rev 0)
+++ sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedField.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -0,0 +1,9 @@
+package org.jboss.seam.encore.grammar.java;
+
+public class MockAnnotatedField
+{
+ @Deprecated
+ @SuppressWarnings("deprecation")
+ @SuppressWarnings(value="unchecked")
+ private String field;
+}
Copied: sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedMethod.java (from rev 13560, sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedMethodFile.java)
===================================================================
--- sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedMethod.java (rev 0)
+++ sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedMethod.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -0,0 +1,11 @@
+package org.jboss.seam.encore.grammar.java;
+
+public class MockAnnotatedMethod
+{
+ @Deprecated
+ @SuppressWarnings("deprecation")
+ @SuppressWarnings(value="unchecked")
+ public MockAnnotatedMethod()
+ {
+ }
+}
Deleted: sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedMethodFile.java
===================================================================
--- sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedMethodFile.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockAnnotatedMethodFile.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -1,11 +0,0 @@
-package org.jboss.seam.encore.grammar.java;
-
-public class MockAnnotatedMethodFile
-{
- @Deprecated
- @SuppressWarnings("deprecation")
- @SuppressWarnings(value="unchecked")
- public MockClassFile()
- {
- }
-}
Copied: sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockClass.java (from rev 13560, sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockClassFile.java)
===================================================================
--- sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockClass.java (rev 0)
+++ sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockClass.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -0,0 +1,18 @@
+package org.jboss.seam.encore.grammar.java;
+
+import java.net.URL;
+
+public class MockClass
+{
+ private String field;
+ private URL urlField;
+
+ public MockClass()
+ {
+ }
+
+ public String valueOf(URL url)
+ {
+ return url.getPath();
+ }
+}
Deleted: sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockClassFile.java
===================================================================
--- sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockClassFile.java 2010-08-05 12:31:27 UTC (rev 13560)
+++ sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockClassFile.java 2010-08-05 17:54:51 UTC (rev 13561)
@@ -1,18 +0,0 @@
-package org.jboss.seam.encore.grammar.java;
-
-import java.net.URL;
-
-public class MockClassFile
-{
- private String field;
- private URL urlField;
-
- public MockClassFile()
- {
- }
-
- public String valueOf(URL url)
- {
- return url.getPath();
- }
-}
More information about the seam-commits
mailing list