01: package org.kohsuke.rngom.digested;
02:
03: import org.kohsuke.rngom.ast.builder.Annotations;
04: import org.kohsuke.rngom.ast.builder.BuildException;
05: import org.kohsuke.rngom.ast.util.LocatorImpl;
06:
07: import javax.xml.namespace.QName;
08:
09: /**
10: * @author Kohsuke Kawaguchi (kk@kohsuke.org)
11: */
12: class Annotation implements
13: Annotations<ElementWrapper, LocatorImpl, CommentListImpl> {
14:
15: private final DAnnotation a = new DAnnotation();
16:
17: public void addAttribute(String ns, String localName,
18: String prefix, String value, LocatorImpl loc)
19: throws BuildException {
20: a.attributes.put(new QName(ns, localName, prefix),
21: new DAnnotation.Attribute(ns, localName, prefix, value,
22: loc));
23: }
24:
25: public void addElement(ElementWrapper ea) throws BuildException {
26: a.contents.add(ea.element);
27: }
28:
29: public void addComment(CommentListImpl comments)
30: throws BuildException {
31: }
32:
33: public void addLeadingComment(CommentListImpl comments)
34: throws BuildException {
35: }
36:
37: DAnnotation getResult() {
38: return a;
39: }
40: }
|