private NodeData parseNodeData(TypeElement templateType, List<TypeElement> typeHierarchy) { AnnotationMirror typeSystemMirror = findFirstAnnotation(typeHierarchy, TypeSystemReference.class); TypeSystemData typeSystem = null; if (typeSystemMirror != null) { TypeMirror typeSystemType = ElementUtils.getAnnotationValue(TypeMirror.class, typeSystemMirror, "value"); typeSystem = (TypeSystemData) context.getTemplate(typeSystemType, true); if (typeSystem == null) { NodeData nodeData = new NodeData(context, templateType); nodeData.addError("The used type system '%s' is invalid. Fix errors in the type system first.", ElementUtils.getQualifiedName(typeSystemType)); return nodeData; } } else { // default dummy type system typeSystem = new TypeSystemData(context, templateType, null, NodeParser.class.getAnnotation(DSLOptions.class), true); } AnnotationMirror nodeInfoMirror = findFirstAnnotation(typeHierarchy, NodeInfo.class); String shortName = null; if (nodeInfoMirror != null) { shortName = ElementUtils.getAnnotationValue(String.class, nodeInfoMirror, "shortName"); } boolean useNodeFactory = findFirstAnnotation(typeHierarchy, GenerateNodeFactory.class) != null; return new NodeData(context, templateType, shortName, typeSystem, useNodeFactory); }
private NodeData parseNodeData(TypeElement templateType, List<TypeElement> typeHierarchy) { AnnotationMirror typeSystemMirror = findFirstAnnotation(typeHierarchy, TypeSystemReference.class); TypeSystemData typeSystem = null; if (typeSystemMirror != null) { TypeMirror typeSystemType = ElementUtils.getAnnotationValue(TypeMirror.class, typeSystemMirror, "value"); typeSystem = (TypeSystemData) context.getTemplate(typeSystemType, true); if (typeSystem == null) { NodeData nodeData = new NodeData(context, templateType); nodeData.addError("The used type system '%s' is invalid. Fix errors in the type system first.", ElementUtils.getQualifiedName(typeSystemType)); return nodeData; } } else { // default dummy type system typeSystem = new TypeSystemData(context, templateType, null, true); } boolean useNodeFactory = findFirstAnnotation(typeHierarchy, GenerateNodeFactory.class) != null; return new NodeData(context, templateType, typeSystem, useNodeFactory); }
TypeElement type = (TypeElement) element; M model = (M) context.getTemplate(type.asType(), false); boolean firstRun = !context.containsTemplate(type);
TypeElement type = (TypeElement) element; M model = (M) context.getTemplate(type.asType(), false); boolean firstRun = !context.containsTemplate(type);