comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/Template.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 c4c3f50fa9c2
children a80bf36c6a1e
comparison
equal deleted inserted replaced
8251:cb70ed101b5f 8252:0905d796944a
27 import javax.lang.model.element.*; 27 import javax.lang.model.element.*;
28 28
29 import com.oracle.truffle.codegen.processor.*; 29 import com.oracle.truffle.codegen.processor.*;
30 import com.oracle.truffle.codegen.processor.api.element.*; 30 import com.oracle.truffle.codegen.processor.api.element.*;
31 31
32 public abstract class Template { 32 public abstract class Template extends MessageContainer {
33 33
34 private final TypeElement templateType; 34 private final TypeElement templateType;
35 private final String templateMethodName; 35 private final String templateMethodName;
36 private final AnnotationMirror annotation; 36 private final AnnotationMirror annotation;
37 37
39 39
40 public Template(TypeElement templateType, String templateMethodName, AnnotationMirror annotation) { 40 public Template(TypeElement templateType, String templateMethodName, AnnotationMirror annotation) {
41 this.templateType = templateType; 41 this.templateType = templateType;
42 this.templateMethodName = templateMethodName; 42 this.templateMethodName = templateMethodName;
43 this.annotation = annotation; 43 this.annotation = annotation;
44 }
45
46 @Override
47 public Element getMessageElement() {
48 return templateType;
49 }
50
51 @Override
52 protected List<MessageContainer> findChildContainers() {
53 return Collections.emptyList();
44 } 54 }
45 55
46 public String getTemplateMethodName() { 56 public String getTemplateMethodName() {
47 return templateMethodName; 57 return templateMethodName;
48 } 58 }