Search in sources :

Example 1 with DTDVisitor

use of org.eclipse.wst.dtd.core.internal.emf.util.DTDVisitor in project webtools.sourceediting by eclipse.

the class DTDElementImpl method getReferences.

// returns all references in the same DTDFile that reference this element
public Collection getReferences() {
    DTDFile file = getDTDFile();
    final Collection result = new ArrayList();
    DTDVisitor visitRefs = new DTDVisitor() {

        public void visitDTDElementReferenceContent(DTDElementReferenceContent elementReferenceContent) {
            if (elementReferenceContent.getReferencedElement() == DTDElementImpl.this) {
                result.add(elementReferenceContent);
            }
        // end of if ()
        }
    };
    visitRefs.visitDTDFile(file);
    return result;
}
Also used : DTDElementReferenceContent(org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent) ArrayList(java.util.ArrayList) Collection(java.util.Collection) DTDVisitor(org.eclipse.wst.dtd.core.internal.emf.util.DTDVisitor) DTDFile(org.eclipse.wst.dtd.core.internal.emf.DTDFile)

Aggregations

ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 DTDElementReferenceContent (org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent)1 DTDFile (org.eclipse.wst.dtd.core.internal.emf.DTDFile)1 DTDVisitor (org.eclipse.wst.dtd.core.internal.emf.util.DTDVisitor)1