001: /*
002: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: * Free SoftwareFoundation, Inc.
023: * 59 Temple Place, Suite 330
024: * Boston, MA 02111-1307 USA
025: *
026: * @author Scott Ferguson
027: */
028:
029: package com.caucho.xpath;
030:
031: import com.caucho.xpath.expr.Var;
032:
033: import org.w3c.dom.Document;
034: import org.w3c.dom.Node;
035:
036: /**
037: * Adds variable environment.
038: */
039: public interface ExprEnvironment {
040: /**
041: * Returns the value associated with name.
042: *
043: * <p><em>name must be interned</em>
044: */
045: public Var getVar(String name);
046:
047: /**
048: * Returns the value associated with name.
049: *
050: * <p><em>name must be interned</em>
051: */
052: public XPathFun getFunction(String name);
053:
054: /**
055: * Sets the node context.
056: */
057: public Node setContextNode(Node node);
058:
059: /**
060: * Returns the StylesheetEnv
061: */
062: public StylesheetEnv getStylesheetEnv();
063:
064: /**
065: * Return context node from the XPath expression context.
066: */
067: Node getContextNode();
068:
069: /**
070: * Returns the context position from the XPath expression context.
071: */
072: int getContextPosition();
073:
074: /**
075: * Returns the context size from the XPath expression context.
076: */
077: int getContextSize();
078:
079: /**
080: * Returns the current node from the XSLT context; the same
081: * as calling current() function from the XPath expression context.
082: */
083: Node getCurrentNode();
084:
085: /**
086: * Returns a Document to be used for creating nodes.
087: */
088: Document getOwnerDocument();
089:
090: /**
091: * Returns an Object representing the value of the system property
092: * whose expanded-name has the specified namespace URI and local part.
093: */
094: Object systemProperty(String namespaceURI, String localName);
095:
096: /**
097: * Returns the string-value of the specified Node.
098: */
099: String stringValue(Node n);
100: }
|