@Override public Void visitType(CodeTypeElement e, Void p) { visitAnnotations(e, e.getAnnotationMirrors()); visitTypeReference(e, e.getSuperclass()); for (TypeMirror type : e.getImplements()) { visitTypeReference(e, type); } return super.visitType(e, p); }
@Override public Void visitType(CodeTypeElement e, Void p) { visitAnnotations(e, e.getAnnotationMirrors()); visitTypeReference(e, e.getSuperclass()); for (TypeMirror type : e.getImplements()) { visitTypeReference(e, type); } return super.visitType(e, p); }
factory.getImplements().add(new CodeTypeMirror.DeclaredCodeTypeMirror(ElementUtils.fromTypeMirror(factoryType), Arrays.asList(sourceType.asType())));
write(" extends ").write(useImport(e, e.getSuperclass())); if (e.getImplements().size() > 0) { write(" implements "); for (int i = 0; i < e.getImplements().size(); i++) { write(useImport(e, e.getImplements().get(i))); if (i < e.getImplements().size() - 1) { write(", ");
write(" extends ").write(useImport(e, e.getSuperclass())); if (e.getImplements().size() > 0) { write(" implements "); for (int i = 0; i < e.getImplements().size(); i++) { write(useImport(e, e.getImplements().get(i))); if (i < e.getImplements().size() - 1) { write(", ");
CodeTypeElement descriptors = new CodeTypeElement(typeModifiers, ElementKind.CLASS, pack, optionsClassName); DeclaredType optionDescriptorsType = context.getDeclaredType(OptionDescriptors.class); descriptors.getImplements().add(optionDescriptorsType);
wrapperType.setSuperClass(resolvedSuperType); if (topLevelClass) { wrapperType.getImplements().add(context.getType(InstrumentableNode.WrapperNode.class)); } else { wrapperType.getImplements().add(context.getType(com.oracle.truffle.api.instrumentation.InstrumentableFactory.WrapperNode.class));
public CodeTypeElement create() { Modifier visibility = ElementUtils.getVisibility(node.getTemplateType().getModifiers()); TypeMirror nodeFactory = ElementUtils.getDeclaredType(ElementUtils.fromTypeMirror(context.getType(NodeFactory.class)), node.getNodeType()); CodeTypeElement clazz = GeneratorUtils.createClass(node, null, modifiers(), factoryClassName(node), null); if (visibility != null) { clazz.getModifiers().add(visibility); } clazz.getModifiers().add(Modifier.FINAL); if (createdFactoryElement != null) { clazz.getImplements().add(nodeFactory); CodeAnnotationMirror supressWarnings = new CodeAnnotationMirror(context.getDeclaredType(SuppressWarnings.class)); supressWarnings.setElementValue(supressWarnings.findExecutableElement("value"), new CodeAnnotationValue(Arrays.asList(new CodeAnnotationValue("unchecked"), new CodeAnnotationValue("rawtypes")))); clazz.getAnnotationMirrors().add(supressWarnings); clazz.add(createNodeFactoryConstructor()); clazz.add(createCreateGetNodeClass()); clazz.add(createCreateGetExecutionSignature()); clazz.add(createCreateGetNodeSignatures()); clazz.add(createCreateNodeMethod()); clazz.add(createGetInstanceMethod(visibility)); clazz.add(createInstanceConstant(clazz.asType())); createFactoryMethods(clazz); } return clazz; }
clazz.getImplements().add(getType(SpecializedNode.class)); clazz.add(createMethodGetSpecializationNode()); clazz.add(createDeepCopyMethod());
private void generateReflectionInfo(CodeTypeElement clazz) { clazz.getImplements().add(context.getType(Introspection.Provider.class)); CodeExecutableElement reflection = new CodeExecutableElement(modifiers(PUBLIC), context.getType(Introspection.class), "getIntrospectionData");