use of org.eclipse.wst.dtd.core.internal.emf.DTDObject in project webtools.sourceediting by eclipse.
the class DTDFileImpl method findObject.
public DTDObject findObject(String relativePath) {
Object[] result = DTDPathnameUtil.parsePathComponent(relativePath);
String type = (String) result[0];
if (type == null)
return null;
String name = (String) result[1];
DTDObject obj = null;
if (type.equals("Elem")) {
// $NON-NLS-1$
obj = findElement(name);
} else if (type.equals("Ent")) {
// $NON-NLS-1$
obj = findEntity(name);
} else if (type.equals("PEnt")) {
// $NON-NLS-1$
obj = findParameterEntityReference(name);
} else if (type.equals("Nota")) {
// $NON-NLS-1$
obj = findNotation(name);
} else {
return null;
}
String restPath = (String) result[3];
if ((restPath == null) || (obj == null)) {
return obj;
} else {
return obj.findObject(restPath);
}
}
use of org.eclipse.wst.dtd.core.internal.emf.DTDObject in project webtools.sourceediting by eclipse.
the class DTDVisitor method visitDTDFile.
public void visitDTDFile(DTDFile file) {
Collection notations = file.listDTDNotation();
for (Iterator i = notations.iterator(); i.hasNext(); ) {
visitDTDNotation((DTDNotation) i.next());
}
Collection entities = file.listDTDEntity();
for (Iterator i = entities.iterator(); i.hasNext(); ) {
visitDTDEntity((DTDEntity) i.next());
}
Collection objects = file.listDTDElementAndDTDParameterEntityReference();
for (Iterator i = objects.iterator(); i.hasNext(); ) {
DTDObject object = (DTDObject) i.next();
if (object instanceof DTDElement) {
visitDTDElement((DTDElement) object);
} else // end of if ()
{
visitDTDParameterEntityReference((DTDParameterEntityReference) object);
}
// end of if ()
}
}
Aggregations