0N/A/*
2362N/A * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
0N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
2362N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2362N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0N/A * or visit www.oracle.com if you need additional information or have any
0N/A * questions.
0N/A */
0N/A
0N/Apackage com.sun.xml.internal.xsom.util;
0N/A
0N/Aimport com.sun.xml.internal.xsom.XSAnnotation;
0N/Aimport com.sun.xml.internal.xsom.XSAttGroupDecl;
0N/Aimport com.sun.xml.internal.xsom.XSAttributeDecl;
0N/Aimport com.sun.xml.internal.xsom.XSAttributeUse;
0N/Aimport com.sun.xml.internal.xsom.XSComplexType;
0N/Aimport com.sun.xml.internal.xsom.XSComponent;
0N/Aimport com.sun.xml.internal.xsom.XSContentType;
0N/Aimport com.sun.xml.internal.xsom.XSElementDecl;
0N/Aimport com.sun.xml.internal.xsom.XSFacet;
0N/Aimport com.sun.xml.internal.xsom.XSModelGroup;
0N/Aimport com.sun.xml.internal.xsom.XSModelGroupDecl;
0N/Aimport com.sun.xml.internal.xsom.XSNotation;
0N/Aimport com.sun.xml.internal.xsom.XSParticle;
0N/Aimport com.sun.xml.internal.xsom.XSSchema;
0N/Aimport com.sun.xml.internal.xsom.XSSimpleType;
0N/Aimport com.sun.xml.internal.xsom.XSWildcard;
0N/Aimport com.sun.xml.internal.xsom.XSIdentityConstraint;
0N/Aimport com.sun.xml.internal.xsom.XSXPath;
0N/Aimport com.sun.xml.internal.xsom.visitor.XSFunction;
0N/A
0N/A/**
0N/A * Utility implementation of {@link XSFunction} that returns
* {@link Boolean} to find something from schema objects.
*
* <p>
* This implementation returns <code>Boolean.FALSE</code> from
* all of the methods. The derived class is expected to override
* some of the methods to actually look for something.
*
* @author
* Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
*/
public class XSFinder implements XSFunction<Boolean> {
/**
* Invokes this object as a visitor with the specified component.
*/
public final boolean find( XSComponent c ) {
return c.apply(this);
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSFunction#annotation(com.sun.xml.internal.xsom.XSAnnotation)
*/
public Boolean annotation(XSAnnotation ann) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSFunction#attGroupDecl(com.sun.xml.internal.xsom.XSAttGroupDecl)
*/
public Boolean attGroupDecl(XSAttGroupDecl decl) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSFunction#attributeDecl(com.sun.xml.internal.xsom.XSAttributeDecl)
*/
public Boolean attributeDecl(XSAttributeDecl decl) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSFunction#attributeUse(com.sun.xml.internal.xsom.XSAttributeUse)
*/
public Boolean attributeUse(XSAttributeUse use) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSFunction#complexType(com.sun.xml.internal.xsom.XSComplexType)
*/
public Boolean complexType(XSComplexType type) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSFunction#schema(com.sun.xml.internal.xsom.XSSchema)
*/
public Boolean schema(XSSchema schema) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSFunction#facet(com.sun.xml.internal.xsom.XSFacet)
*/
public Boolean facet(XSFacet facet) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSFunction#notation(com.sun.xml.internal.xsom.XSNotation)
*/
public Boolean notation(XSNotation notation) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSContentTypeFunction#simpleType(com.sun.xml.internal.xsom.XSSimpleType)
*/
public Boolean simpleType(XSSimpleType simpleType) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSContentTypeFunction#particle(com.sun.xml.internal.xsom.XSParticle)
*/
public Boolean particle(XSParticle particle) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSContentTypeFunction#empty(com.sun.xml.internal.xsom.XSContentType)
*/
public Boolean empty(XSContentType empty) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSTermFunction#wildcard(com.sun.xml.internal.xsom.XSWildcard)
*/
public Boolean wildcard(XSWildcard wc) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSTermFunction#modelGroupDecl(com.sun.xml.internal.xsom.XSModelGroupDecl)
*/
public Boolean modelGroupDecl(XSModelGroupDecl decl) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSTermFunction#modelGroup(com.sun.xml.internal.xsom.XSModelGroup)
*/
public Boolean modelGroup(XSModelGroup group) {
return Boolean.FALSE;
}
/**
* @see com.sun.xml.internal.xsom.visitor.XSTermFunction#elementDecl(com.sun.xml.internal.xsom.XSElementDecl)
*/
public Boolean elementDecl(XSElementDecl decl) {
return Boolean.FALSE;
}
public Boolean identityConstraint(XSIdentityConstraint decl) {
return Boolean.FALSE;
}
public Boolean xpath(XSXPath xpath) {
return Boolean.FALSE;
}
}