All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.thaiopensource.relaxng.edit.Annotated Maven / Gradle / Ivy

The newest version!
package com.thaiopensource.relaxng.edit;

import java.util.List;
import java.util.Vector;

public abstract class Annotated extends SourceObject {
  private final List leadingComments = new Vector();
  private final List attributeAnnotations = new Vector();
  private final List childElementAnnotations = new Vector();
  private final List followingElementAnnotations = new Vector();
  private NamespaceContext context;

  public List getLeadingComments() {
    return leadingComments;
  }

  public List getAttributeAnnotations() {
    return attributeAnnotations;
  }

  public List getChildElementAnnotations() {
    return childElementAnnotations;
  }

  public List getFollowingElementAnnotations() {
    return followingElementAnnotations;
  }

  public boolean mayContainText() {
    return false;
  }

  public NamespaceContext getContext() {
    return context;
  }

  public void setContext(NamespaceContext context) {
    this.context = context;
  }

  public String getAttributeAnnotation(String ns, String localName) {
    for (AttributeAnnotation a : attributeAnnotations)
      if (a.getNamespaceUri().equals(ns) && a.getLocalName().equals(localName))
        return a.getValue();

    return null;
  }

  public void attributeAnnotationsAccept(AttributeAnnotationVisitor visitor) {
    for (AttributeAnnotation a : attributeAnnotations)
      a.accept(visitor);
  }

  public void childElementAnnotationsAccept(AnnotationChildVisitor visitor) {
    for (AnnotationChild a : childElementAnnotations)
      a.accept(visitor);
  }

  public void followingElementAnnotationsAccept(AnnotationChildVisitor visitor) {
    for (AnnotationChild a : followingElementAnnotations)
      a.accept(visitor);
  }

  public void leadingCommentsAccept(AnnotationChildVisitor visitor) {
    for (Comment c : leadingComments)
      c.accept(visitor);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy