01: package org.kohsuke.rngom.parse.host;
02:
03: import org.kohsuke.rngom.ast.builder.BuildException;
04: import org.kohsuke.rngom.ast.builder.CommentList;
05: import org.kohsuke.rngom.ast.builder.ElementAnnotationBuilder;
06: import org.kohsuke.rngom.ast.om.Location;
07: import org.kohsuke.rngom.ast.om.ParsedElementAnnotation;
08:
09: /**
10: *
11: * @author
12: * Kohsuke Kawaguchi (kk@kohsuke.org)
13: */
14: final class ElementAnnotationBuilderHost extends AnnotationsHost
15: implements ElementAnnotationBuilder {
16: final ElementAnnotationBuilder lhs;
17: final ElementAnnotationBuilder rhs;
18:
19: ElementAnnotationBuilderHost(ElementAnnotationBuilder lhs,
20: ElementAnnotationBuilder rhs) {
21: super (lhs, rhs);
22: this .lhs = lhs;
23: this .rhs = rhs;
24: }
25:
26: public void addText(String value, Location _loc,
27: CommentList _comments) throws BuildException {
28: LocationHost loc = cast(_loc);
29: CommentListHost comments = (CommentListHost) _comments;
30:
31: lhs.addText(value, loc.lhs, comments == null ? null
32: : comments.lhs);
33: rhs.addText(value, loc.rhs, comments == null ? null
34: : comments.rhs);
35: }
36:
37: public ParsedElementAnnotation makeElementAnnotation()
38: throws BuildException {
39: return new ParsedElementAnnotationHost(lhs
40: .makeElementAnnotation(), rhs.makeElementAnnotation());
41: }
42: }
|