01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19:
20: package org.netbeans.modules.xml.xpath.ext;
21:
22: import javax.xml.namespace.QName;
23: import org.netbeans.modules.xml.schema.model.ReferenceableSchemaComponent;
24: import org.netbeans.modules.xml.xpath.ext.spi.XPathVariable;
25:
26: /**
27: * Represents an XPath variable.
28: * The variable can have quite wide interpretation.
29: *
30: * For example, the BPEL has an extension which allows using variables
31: * of a WSDL Message type in XPath. Such variables are always used
32: * with a Message Part. In the XPath expression the variable name
33: * goes first and it should be followed with a part name. The part
34: * name is separated from the variable name with the dot character.
35: * So in case of BPEL the method getVariableName() can return not just
36: * the name of variable, but its combination with part name.
37: * The method getVariable() can't simply return BPEL Variable object.
38: * In order to support Message variables it has to return special container,
39: * which can hold a Message part as well.
40: *
41: * The method getType() doesn't depend on the kind of variable.
42: * It has always return Schema component which will be used as a
43: * context for subsequent elements of the XPath expression.
44: *
45: * In case of a BPEL Message type varialbe, the method getType() should
46: * return the type of Message Part.
47: *
48: * @author radval
49: * @author nk160297
50: */
51: public interface XPathVariableReference extends XPathExpression,
52: XPathSchemaContextHolder {
53:
54: QName getVariableName();
55:
56: /**
57: * Returns the object which is provided by the VariableResolver.
58: * The type is specific to a module which is used the XPath model.
59: * See description of the interface above.
60: */
61: XPathVariable getVariable();
62:
63: /**
64: * ReferenceableSchemaComponent is the base interface for many different
65: * elements of the schema model. But it is implied that only those, which
66: * can be used as a type of variable, can be returned:
67: * - Global schema type (primitive, simple, complex)
68: * - Global schema element
69: *
70: * Unfortunately the Schema model doesn't have a special marker interface
71: * for such cases.
72: */
73: ReferenceableSchemaComponent getType();
74: }
|