blob: 7fa42ca99aea2c7837d53fe20ad9935c05f6067a [file] [log] [blame]
/*
* Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
package com.sun.xml.xsom;
import java.util.Iterator;
import java.util.Collection;
import com.sun.xml.xsom.visitor.XSWildcardFunction;
import com.sun.xml.xsom.visitor.XSWildcardVisitor;
/**
* Wildcard schema component (used for both attribute wildcard
* and element wildcard.)
*
* XSWildcard interface can always be downcasted to either
* Any, Other, or Union.
*/
public interface XSWildcard extends XSComponent, XSTerm
{
int LAX = 1;
int STRTICT = 2;
int SKIP = 3;
/**
* Gets the processing mode.
*
* @return
* Either LAX, STRICT, or SKIP.
*/
int getMode();
/**
* Returns true if the specified namespace URI is valid
* wrt this wildcard.
*
* @param namespaceURI
* Use the empty string to test the default no-namespace.
*/
boolean acceptsNamespace(String namespaceURI);
/** Visitor support. */
void visit(XSWildcardVisitor visitor);
<T> T apply(XSWildcardFunction<T> function);
/**
* <code>##any</code> wildcard.
*/
interface Any extends XSWildcard {
}
/**
* <code>##other</code> wildcard.
*/
interface Other extends XSWildcard {
/**
* Gets the namespace URI excluded from this wildcard.
*/
String getOtherNamespace();
}
/**
* Wildcard of a set of namespace URIs.
*/
interface Union extends XSWildcard {
/**
* Short for <code>getNamespaces().iterator()</code>
*/
Iterator<String> iterateNamespaces();
/**
* Read-only list of namespace URIs.
*/
Collection<String> getNamespaces();
}
}