Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDVisitor.java')
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDVisitor.java108
1 files changed, 0 insertions, 108 deletions
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDVisitor.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDVisitor.java
deleted file mode 100644
index d3e6d01c28..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDVisitor.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.util;
-
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.ParameterEntityReference;
-
-
-public class DTDVisitor {
-
- public DTDVisitor() {
-
- }
-
- // utility method
- public boolean isParameterEntityRef(String reference) {
- if (reference.length() > 0) {
- return reference.charAt(0) == '%' && reference.charAt(reference.length() - 1) == ';';
- }
- return false;
- }
-
- public void visit(DTDFile file) {
- List nodes = file.getNodes();
- for (int i = 0; i < nodes.size(); i++) {
- DTDNode currentNode = (DTDNode) nodes.get(i);
- if (currentNode instanceof Element) {
- visitElement((Element) currentNode);
- }
- else if (currentNode instanceof AttributeList) {
- visitAttributeList((AttributeList) currentNode);
- }
- else if (currentNode instanceof ParameterEntityReference) {
- visitExternalParameterEntityReference((ParameterEntityReference) currentNode);
- }
- }
- }
-
- public void visitAttribute(Attribute attr) {
- }
-
- public void visitAttributeList(AttributeList attList) {
- // note that we don't visit attributes here because we
- // want the element to visit them with it's consolidated list
- // that it creates by gathering all attribute lists together
- }
-
- public void visitAttributes(List attributes) {
- int size = attributes.size();
- for (int i = 0; i < size; i++) {
- Attribute attr = (Attribute) attributes.get(i);
- visitAttribute(attr);
- }
- }
-
- public void visitContentNode(CMNode content) {
- if (content instanceof CMBasicNode) {
- CMBasicNode basicNode = (CMBasicNode) content;
- if (basicNode.isReference()) {
- visitReference(basicNode);
- }
- }
- else if (content instanceof CMGroupNode) {
- visitGroupNode((CMGroupNode) content);
- }
- }
-
- public void visitElement(Element element) {
- CMNode content = element.getContentModel();
- visitContentNode(content);
- visitAttributes(element.getElementAttributes());
- }
-
- public void visitExternalParameterEntityReference(ParameterEntityReference parmEntityRef) {
- }
-
- public void visitGroupNode(CMGroupNode group) {
- List children = group.getChildrenList();
- int size = children.size();
- for (int i = 0; i < size; i++) {
- visitContentNode((CMNode) children.get(i));
- }
- }
-
- public void visitReference(CMBasicNode node) {
- }
-
-
-}

Back to the top