286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 2005 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/Apackage com.sun.org.apache.xerces.internal.xpointer;
286N/A
286N/Aimport com.sun.org.apache.xerces.internal.xni.Augmentations;
286N/Aimport com.sun.org.apache.xerces.internal.xni.QName;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XMLAttributes;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XNIException;
286N/A
286N/A/**
286N/A * <p>
286N/A * Used for scheme specific parsing and evaluation of an XPointer expression.
286N/A * This interface applies to both ShortHand and SchemeBased XPointer
286N/A * expressions.
286N/A * </p>
286N/A *
286N/A * @xerces.internal
286N/A *
286N/A */
286N/Apublic interface XPointerPart {
286N/A
286N/A // The start element event
286N/A public static final int EVENT_ELEMENT_START = 0;
286N/A
286N/A // The end element event
286N/A public static final int EVENT_ELEMENT_END = 1;
286N/A
286N/A // The empty element event
286N/A public static final int EVENT_ELEMENT_EMPTY = 2;
286N/A
286N/A /**
286N/A * Provides scheme specific parsing of a XPointer expression i.e.
286N/A * the PointerPart or ShortHandPointer.
286N/A *
286N/A * @param xpointer A String representing the PointerPart or ShortHandPointer.
286N/A * @throws XNIException Thrown if the PointerPart string does not conform to
286N/A * the syntax defined by its scheme.
286N/A *
286N/A */
286N/A public void parseXPointer(String part) throws XNIException;
286N/A
286N/A /**
286N/A * Evaluates an XML resource with respect to an XPointer expressions
286N/A * by checking if it's element and attributes parameters match the
286N/A * criteria specified in the xpointer expression.
286N/A *
286N/A * @param element - The name of the element.
286N/A * @param attributes - The element attributes.
286N/A * @param augs - Additional information that may include infoset augmentations
286N/A * @param event - An integer indicating
286N/A * 0 - The start of an element
286N/A * 1 - The end of an element
286N/A * 2 - An empty element call
286N/A * @throws XNIException Thrown to signal an error
286N/A *
286N/A */
286N/A public boolean resolveXPointer(QName element, XMLAttributes attributes,
286N/A Augmentations augs, int event) throws XNIException;
286N/A
286N/A /**
286N/A * Returns true if the XPointer expression resolves to a resource fragment
286N/A * specified as input else returns false.
286N/A *
286N/A * @return True if the xpointer expression matches a fragment in the resource
286N/A * else returns false.
286N/A * @throws XNIException Thrown to signal an error
286N/A *
286N/A */
286N/A public boolean isFragmentResolved() throws XNIException;
286N/A
286N/A /**
286N/A * Returns true if the XPointer expression resolves to a non-element child
286N/A * of the current resource fragment.
286N/A *
286N/A * @return True if the XPointer expression resolves to a non-element child
286N/A * of the current resource fragment.
286N/A * @throws XNIException Thrown to signal an error
286N/A *
286N/A */
286N/A public boolean isChildFragmentResolved() throws XNIException;
286N/A
286N/A /**
286N/A * Returns a String containing the scheme name of the PointerPart
286N/A * or the name of the ShortHand Pointer.
286N/A *
286N/A * @return A String containing the scheme name of the PointerPart.
286N/A *
286N/A */
286N/A public String getSchemeName();
286N/A
286N/A /**
286N/A * Returns a String containing the scheme data of the PointerPart.
286N/A *
286N/A * @return A String containing the scheme data of the PointerPart.
286N/A *
286N/A */
286N/A public String getSchemeData();
286N/A
286N/A /**
286N/A * Sets the scheme name of the PointerPart or the ShortHand Pointer name.
286N/A *
286N/A * @param schemeName A String containing the scheme name of the PointerPart.
286N/A *
286N/A */
286N/A public void setSchemeName(String schemeName);
286N/A
286N/A /**
286N/A * Sets the scheme data of the PointerPart.
286N/A *
286N/A * @param schemeData A String containing the scheme data of the PointerPart.
286N/A *
286N/A */
286N/A public void setSchemeData(String schemeData);
286N/A
286N/A}