comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/TemplateMethod.java @ 8252:0905d796944a

Refactored codegen error model to make error redirection a lot easier.
author Christian Humer <christian.humer@gmail.com>
date Wed, 13 Mar 2013 19:58:28 +0100
parents cb70ed101b5f
children 89006c76f737
comparison
equal deleted inserted replaced
8251:cb70ed101b5f 8252:0905d796944a
27 import javax.lang.model.element.*; 27 import javax.lang.model.element.*;
28 import javax.lang.model.type.*; 28 import javax.lang.model.type.*;
29 29
30 import com.oracle.truffle.codegen.processor.*; 30 import com.oracle.truffle.codegen.processor.*;
31 31
32 public class TemplateMethod { 32 public class TemplateMethod extends MessageContainer {
33 33
34 private String id; 34 private String id;
35 private final Template template; 35 private final Template template;
36 private final MethodSpec specification; 36 private final MethodSpec specification;
37 private final ExecutableElement method; 37 private final ExecutableElement method;
56 } 56 }
57 } 57 }
58 58
59 public TemplateMethod(TemplateMethod method) { 59 public TemplateMethod(TemplateMethod method) {
60 this(method.id, method.template, method.specification, method.method, method.markerAnnotation, method.returnType, method.parameters); 60 this(method.id, method.template, method.specification, method.method, method.markerAnnotation, method.returnType, method.parameters);
61 getMessages().addAll(method.getMessages());
62 }
63
64 @Override
65 public Element getMessageElement() {
66 return method;
67 }
68
69 @Override
70 public AnnotationMirror getMessageAnnotation() {
71 return markerAnnotation;
72 }
73
74 @Override
75 protected List<MessageContainer> findChildContainers() {
76 return Collections.emptyList();
61 } 77 }
62 78
63 public void setId(String id) { 79 public void setId(String id) {
64 this.id = id; 80 this.id = id;
65 } 81 }