KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > xpointer > XPointer


1 /*
2  * Copyright 1999-2004 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 org.apache.cocoon.components.xpointer;
17
18 import org.xml.sax.SAXException JavaDoc;
19 import org.apache.cocoon.ResourceNotFoundException;
20
21 import java.util.List JavaDoc;
22 import java.util.LinkedList JavaDoc;
23 import java.util.Iterator JavaDoc;
24
25 /**
26  * Represents a fragment identifier conforming to the XML Pointer Language Framework.
27  * See also the specification at <a HREF="http://www.w3.org/TR/2003/REC-xptr-framework-20030325">
28  * http://www.w3.org/TR/2003/REC-xptr-framework-20030325</a>.
29  *
30  * <p>To create an instance of this class, call
31  * {@link org.apache.cocoon.components.xpointer.parser.XPointerFrameworkParser#parse(String)}.
32  */

33 public class XPointer {
34     private List JavaDoc pointerParts = new LinkedList JavaDoc();
35
36     public void addPart(PointerPart part) {
37         pointerParts.add(part);
38     }
39
40     public void process(XPointerContext context) throws SAXException JavaDoc, ResourceNotFoundException {
41         Iterator JavaDoc pointerPartsIt = pointerParts.iterator();
42         while (pointerPartsIt.hasNext()) {
43             PointerPart part = (PointerPart)pointerPartsIt.next();
44             part.process(context);
45         }
46     }
47 }
48
Popular Tags