KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xerces > internal > xpointer > XPointerPart


1 /*
2  * Copyright 2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.sun.org.apache.xerces.internal.xpointer;
17
18 import com.sun.org.apache.xerces.internal.xni.Augmentations;
19 import com.sun.org.apache.xerces.internal.xni.QName;
20 import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
21 import com.sun.org.apache.xerces.internal.xni.XNIException;
22
23 /**
24  * <p>
25  * Used for scheme specific parsing and evaluation of an XPointer expression.
26  * This interface applies to both ShortHand and SchemeBased XPointer
27  * expressions.
28  * </p>
29  *
30  * @xerces.internal
31  *
32  * @version $Id: XPointerPart.java,v 1.1.4.1 2005/09/08 05:25:45 sunithareddy Exp $
33  */

34 public interface XPointerPart {
35
36     // The start element event
37
public static final int EVENT_ELEMENT_START = 0;
38
39     // The end element event
40
public static final int EVENT_ELEMENT_END = 1;
41
42     // The empty element event
43
public static final int EVENT_ELEMENT_EMPTY = 2;
44
45     /**
46      * Provides scheme specific parsing of a XPointer expression i.e.
47      * the PointerPart or ShortHandPointer.
48      *
49      * @param xpointer A String representing the PointerPart or ShortHandPointer.
50      * @throws XNIException Thrown if the PointerPart string does not conform to
51      * the syntax defined by its scheme.
52      *
53      */

54     public void parseXPointer(String JavaDoc part) throws XNIException;
55
56     /**
57      * Evaluates an XML resource with respect to an XPointer expressions
58      * by checking if it's element and attributes parameters match the
59      * criteria specified in the xpointer expression.
60      *
61      * @param element - The name of the element.
62      * @param attributes - The element attributes.
63      * @param augs - Additional information that may include infoset augmentations
64      * @param event - An integer indicating
65      * 0 - The start of an element
66      * 1 - The end of an element
67      * 2 - An empty element call
68      * @throws XNIException Thrown to signal an error
69      *
70      */

71     public boolean resolveXPointer(QName element, XMLAttributes attributes,
72             Augmentations augs, int event) throws XNIException;
73
74     /**
75      * Returns true if the XPointer expression resolves to a resource fragment
76      * specified as input else returns false.
77      *
78      * @return True if the xpointer expression matches a fragment in the resource
79      * else returns false.
80      * @throws XNIException Thrown to signal an error
81      *
82      */

83     public boolean isFragmentResolved() throws XNIException;
84     
85     /**
86      * Returns true if the XPointer expression resolves to a non-element child
87      * of the current resource fragment.
88      *
89      * @return True if the XPointer expression resolves to a non-element child
90      * of the current resource fragment.
91      * @throws XNIException Thrown to signal an error
92      *
93      */

94     public boolean isChildFragmentResolved() throws XNIException;
95
96     /**
97      * Returns a String containing the scheme name of the PointerPart
98      * or the name of the ShortHand Pointer.
99      *
100      * @return A String containing the scheme name of the PointerPart.
101      *
102      */

103     public String JavaDoc getSchemeName();
104
105     /**
106      * Returns a String containing the scheme data of the PointerPart.
107      *
108      * @return A String containing the scheme data of the PointerPart.
109      *
110      */

111     public String JavaDoc getSchemeData();
112
113     /**
114      * Sets the scheme name of the PointerPart or the ShortHand Pointer name.
115      *
116      * @param schemeName A String containing the scheme name of the PointerPart.
117      *
118      */

119     public void setSchemeName(String JavaDoc schemeName);
120
121     /**
122      * Sets the scheme data of the PointerPart.
123      *
124      * @param schemeData A String containing the scheme data of the PointerPart.
125      *
126      */

127     public void setSchemeData(String JavaDoc schemeData);
128
129 }
Popular Tags