diff options
Diffstat (limited to 'bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11FindInnerElementVisitor.java')
-rw-r--r-- | bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11FindInnerElementVisitor.java | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11FindInnerElementVisitor.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11FindInnerElementVisitor.java deleted file mode 100644 index c9a52483f..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/adapters/visitor/W11FindInnerElementVisitor.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2007 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 - *******************************************************************************/ -package org.eclipse.wst.wsdl.ui.internal.adapters.visitor; - -import org.eclipse.xsd.XSDElementDeclaration; - -/* - * Class used to find and return the "inner" XSDElement when given an XSDElement. - * This class extends W11XSDVisitor which removes the need for this class to reimplement - * the actual traversal of the XSD Model to locate the inner XSDElement. - * - * By default, this class will locate the inner XSDElement at depth 2. However, this depth - * can be changed by calling setElementDepth(newDepth). - */ -public class W11FindInnerElementVisitor extends W11XSDVisitor { - protected XSDElementDeclaration elementAtDepth; - protected int elementDepth = 2; - protected int depth = 1; - - public XSDElementDeclaration getInnerXSDElement(XSDElementDeclaration xsdElement) { - elementAtDepth = xsdElement; - depth = 1; - visitElementDeclaration(xsdElement); - - return elementAtDepth; - } - - public void visitElementDeclaration(XSDElementDeclaration element) { - if (depth == elementDepth) { - elementAtDepth = element; - } - depth++; - - super.visitElementDeclaration(element); - } - - public void setElementDepth(int elementDepth) { - this.elementDepth = elementDepth; - } -} |