Search in sources :

Example 1 with VariableRuntimeBuilderContext

use of spoon.support.visitor.java.internal.VariableRuntimeBuilderContext in project spoon by INRIA.

the class JavaReflectionTreeBuilder method visitField.

@Override
public void visitField(Field field) {
    final CtField<Object> ctField = factory.Core().createField();
    ctField.setSimpleName(field.getName());
    setModifier(ctField, field.getModifiers());
    enter(new VariableRuntimeBuilderContext(ctField));
    super.visitField(field);
    exit();
    contexts.peek().addField(ctField);
}
Also used : VariableRuntimeBuilderContext(spoon.support.visitor.java.internal.VariableRuntimeBuilderContext)

Example 2 with VariableRuntimeBuilderContext

use of spoon.support.visitor.java.internal.VariableRuntimeBuilderContext in project spoon by INRIA.

the class JavaReflectionTreeBuilder method visitEnumValue.

@Override
public void visitEnumValue(Field field) {
    final CtEnumValue<Object> ctEnumValue = factory.Core().createEnumValue();
    ctEnumValue.setSimpleName(field.getName());
    enter(new VariableRuntimeBuilderContext(ctEnumValue));
    super.visitEnumValue(field);
    exit();
    contexts.peek().addEnumValue(ctEnumValue);
}
Also used : VariableRuntimeBuilderContext(spoon.support.visitor.java.internal.VariableRuntimeBuilderContext)

Example 3 with VariableRuntimeBuilderContext

use of spoon.support.visitor.java.internal.VariableRuntimeBuilderContext in project spoon by INRIA.

the class JavaReflectionTreeBuilder method visitParameter.

@Override
public void visitParameter(RtParameter parameter) {
    final CtParameter ctParameter = factory.Core().createParameter();
    ctParameter.setSimpleName(parameter.getName());
    ctParameter.setVarArgs(parameter.isVarArgs());
    enter(new VariableRuntimeBuilderContext(ctParameter));
    super.visitParameter(parameter);
    exit();
    contexts.peek().addParameter(ctParameter);
}
Also used : VariableRuntimeBuilderContext(spoon.support.visitor.java.internal.VariableRuntimeBuilderContext) CtParameter(spoon.reflect.declaration.CtParameter)

Aggregations

VariableRuntimeBuilderContext (spoon.support.visitor.java.internal.VariableRuntimeBuilderContext)3 CtParameter (spoon.reflect.declaration.CtParameter)1