diff --git a/src/main/java/spoon/reflect/annotations/MetamodelPropertyField.java b/src/main/java/spoon/reflect/annotations/MetamodelPropertyField.java index 3f9d9997859..b563912c968 100644 --- a/src/main/java/spoon/reflect/annotations/MetamodelPropertyField.java +++ b/src/main/java/spoon/reflect/annotations/MetamodelPropertyField.java @@ -33,5 +33,5 @@ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.FIELD }) public @interface MetamodelPropertyField { - CtRole role(); + CtRole[] role(); } diff --git a/src/main/java/spoon/reflect/code/CtCase.java b/src/main/java/spoon/reflect/code/CtCase.java index 5a92571cf11..c0de36932d3 100644 --- a/src/main/java/spoon/reflect/code/CtCase.java +++ b/src/main/java/spoon/reflect/code/CtCase.java @@ -19,8 +19,7 @@ import spoon.reflect.annotations.PropertyGetter; import spoon.reflect.annotations.PropertySetter; -import static spoon.reflect.path.CtRole.CASE; - +import static spoon.reflect.path.CtRole.EXPRESSION; /** * This code element defines a case within a switch-case. @@ -40,13 +39,13 @@ public interface CtCase extends CtStatement, CtStatementList { /** * Gets the case expression. */ - @PropertyGetter(role = CASE) + @PropertyGetter(role = EXPRESSION) CtExpression getCaseExpression(); /** * Sets the case expression. */ - @PropertySetter(role = CASE) + @PropertySetter(role = EXPRESSION) > T setCaseExpression(CtExpression caseExpression); @Override diff --git a/src/main/java/spoon/reflect/declaration/CtCodeSnippet.java b/src/main/java/spoon/reflect/declaration/CtCodeSnippet.java index bada4f297b2..5745164a480 100644 --- a/src/main/java/spoon/reflect/declaration/CtCodeSnippet.java +++ b/src/main/java/spoon/reflect/declaration/CtCodeSnippet.java @@ -36,13 +36,13 @@ public interface CtCodeSnippet { /** * Sets the textual value of the code. */ - @PropertyGetter(role = EXPRESSION) + @PropertySetter(role = EXPRESSION) C setValue(String value); /** * Gets the textual value of the code. */ - @PropertySetter(role = EXPRESSION) + @PropertyGetter(role = EXPRESSION) String getValue(); } diff --git a/src/main/java/spoon/support/reflect/code/CtCaseImpl.java b/src/main/java/spoon/support/reflect/code/CtCaseImpl.java index a90388099ad..534d6c80b86 100644 --- a/src/main/java/spoon/support/reflect/code/CtCaseImpl.java +++ b/src/main/java/spoon/support/reflect/code/CtCaseImpl.java @@ -34,7 +34,7 @@ public class CtCaseImpl extends CtStatementImpl implements CtCase { private static final long serialVersionUID = 1L; - @MetamodelPropertyField(role = CtRole.CASE) + @MetamodelPropertyField(role = CtRole.EXPRESSION) CtExpression caseExpression; @MetamodelPropertyField(role = CtRole.STATEMENT) diff --git a/src/main/java/spoon/support/reflect/declaration/CtTypeImpl.java b/src/main/java/spoon/support/reflect/declaration/CtTypeImpl.java index 01af41fe9a2..1fe37f49f0a 100644 --- a/src/main/java/spoon/support/reflect/declaration/CtTypeImpl.java +++ b/src/main/java/spoon/support/reflect/declaration/CtTypeImpl.java @@ -81,7 +81,7 @@ public abstract class CtTypeImpl extends CtNamedElementImpl implements CtType @MetamodelPropertyField(role = CtRole.MODIFIER) Set modifiers = emptySet(); - @MetamodelPropertyField(role = CtRole.FIELD) + @MetamodelPropertyField(role = {CtRole.FIELD, CtRole.EXECUTABLE, CtRole.NESTED_TYPE}) List typeMembers = emptyList(); public CtTypeImpl() {