~ubuntu-branches/debian/wheezy/jing-trang/wheezy

« back to all changes in this revision

Viewing changes to mod/rng-schema/src/main/com/thaiopensource/relaxng/edit/Annotated.java

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Thibault
  • Date: 2009-09-01 15:53:03 UTC
  • Revision ID: james.westby@ubuntu.com-20090901155303-2kweef05h5v9j3ni
Tags: upstream-20090818
ImportĀ upstreamĀ versionĀ 20090818

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package com.thaiopensource.relaxng.edit;
 
2
 
 
3
import java.util.List;
 
4
import java.util.Vector;
 
5
 
 
6
public abstract class Annotated extends SourceObject {
 
7
  private final List<Comment> leadingComments = new Vector<Comment>();
 
8
  private final List<AttributeAnnotation> attributeAnnotations = new Vector<AttributeAnnotation>();
 
9
  private final List<AnnotationChild> childElementAnnotations = new Vector<AnnotationChild>();
 
10
  private final List<AnnotationChild> followingElementAnnotations = new Vector<AnnotationChild>();
 
11
  private NamespaceContext context;
 
12
 
 
13
  public List<Comment> getLeadingComments() {
 
14
    return leadingComments;
 
15
  }
 
16
 
 
17
  public List<AttributeAnnotation> getAttributeAnnotations() {
 
18
    return attributeAnnotations;
 
19
  }
 
20
 
 
21
  public List<AnnotationChild> getChildElementAnnotations() {
 
22
    return childElementAnnotations;
 
23
  }
 
24
 
 
25
  public List<AnnotationChild> getFollowingElementAnnotations() {
 
26
    return followingElementAnnotations;
 
27
  }
 
28
 
 
29
  public boolean mayContainText() {
 
30
    return false;
 
31
  }
 
32
 
 
33
  public NamespaceContext getContext() {
 
34
    return context;
 
35
  }
 
36
 
 
37
  public void setContext(NamespaceContext context) {
 
38
    this.context = context;
 
39
  }
 
40
 
 
41
  public String getAttributeAnnotation(String ns, String localName) {
 
42
    for (AttributeAnnotation a : attributeAnnotations)
 
43
      if (a.getNamespaceUri().equals(ns) && a.getLocalName().equals(localName))
 
44
        return a.getValue();
 
45
 
 
46
    return null;
 
47
  }
 
48
 
 
49
  public void attributeAnnotationsAccept(AttributeAnnotationVisitor<?> visitor) {
 
50
    for (AttributeAnnotation a : attributeAnnotations)
 
51
      a.accept(visitor);
 
52
  }
 
53
 
 
54
  public void childElementAnnotationsAccept(AnnotationChildVisitor<?> visitor) {
 
55
    for (AnnotationChild a : childElementAnnotations)
 
56
      a.accept(visitor);
 
57
  }
 
58
 
 
59
  public void followingElementAnnotationsAccept(AnnotationChildVisitor<?> visitor) {
 
60
    for (AnnotationChild a : followingElementAnnotations)
 
61
      a.accept(visitor);
 
62
  }
 
63
 
 
64
  public void leadingCommentsAccept(AnnotationChildVisitor<?> visitor) {
 
65
    for (Comment c : leadingComments)
 
66
      c.accept(visitor);
 
67
  }
 
68
}