com.thaiopensource.relaxng.edit.Annotated Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of trang Show documentation
Show all versions of trang Show documentation
Jing/Trang - tools for validating and translating RelaxNG
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);
}
}