01: package com.sun.xml.xsom.impl;
02:
03: import com.sun.xml.xsom.XSIdentityConstraint;
04: import com.sun.xml.xsom.XSXPath;
05: import com.sun.xml.xsom.XmlString;
06: import com.sun.xml.xsom.impl.parser.SchemaDocumentImpl;
07: import com.sun.xml.xsom.visitor.XSFunction;
08: import com.sun.xml.xsom.visitor.XSVisitor;
09: import org.xml.sax.Locator;
10:
11: /**
12: * @author Kohsuke Kawaguchi
13: */
14: public class XPathImpl extends ComponentImpl implements XSXPath {
15: private XSIdentityConstraint parent;
16: private final XmlString xpath;
17:
18: public XPathImpl(SchemaDocumentImpl _owner, AnnotationImpl _annon,
19: Locator _loc, ForeignAttributesImpl fa, XmlString xpath) {
20: super (_owner, _annon, _loc, fa);
21: this .xpath = xpath;
22: }
23:
24: public void setParent(XSIdentityConstraint parent) {
25: this .parent = parent;
26: }
27:
28: public XSIdentityConstraint getParent() {
29: return parent;
30: }
31:
32: public XmlString getXPath() {
33: return xpath;
34: }
35:
36: public void visit(XSVisitor visitor) {
37: visitor.xpath(this );
38: }
39:
40: public <T> T apply(XSFunction<T> function) {
41: return function.xpath(this);
42: }
43: }
|