Source Code Cross Referenced for Arg.java in  » XML » xalan » org » apache » xpath » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » xalan » org.apache.xpath 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 1999-2004 The Apache Software Foundation.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        /*
017:         * $Id: Arg.java,v 1.15 2004/02/17 04:30:02 minchau Exp $
018:         */
019:        package org.apache.xpath;
020:
021:        import org.apache.xml.utils.QName;
022:        import org.apache.xpath.objects.XObject;
023:
024:        /**
025:         * This class holds an instance of an argument on
026:         * the stack. The value of the argument can be either an
027:         * XObject or a String containing an expression.
028:         * @xsl.usage internal
029:         */
030:        public class Arg {
031:
032:            /** Field m_qname: The name of this argument, expressed as a QName
033:             * (Qualified Name) object.
034:             * @see getQName
035:             * @see setQName
036:             *  */
037:            private QName m_qname;
038:
039:            /**
040:             * Get the qualified name for this argument.
041:             *
042:             * @return QName object containing the qualified name
043:             */
044:            public final QName getQName() {
045:                return m_qname;
046:            }
047:
048:            /**
049:             * Set the qualified name for this argument.
050:             *
051:             * @param name QName object representing the new Qualified Name.
052:             */
053:            public final void setQName(QName name) {
054:                m_qname = name;
055:            }
056:
057:            /** Field m_val: Stored XObject value of this argument
058:             * @see #getVal()
059:             * @see #setVal()
060:             */
061:            private XObject m_val;
062:
063:            /**
064:             * Get the value for this argument.
065:             *
066:             * @return the argument's stored XObject value.
067:             * @see #setVal(XObject)
068:             */
069:            public final XObject getVal() {
070:                return m_val;
071:            }
072:
073:            /**
074:             * Set the value of this argument.
075:             *
076:             * @param val an XObject representing the arguments's value.
077:             * @see #getVal()
078:             */
079:            public final void setVal(XObject val) {
080:                m_val = val;
081:            }
082:
083:            /**
084:             * Have the object release it's resources.
085:             * Call only when the variable or argument is going out of scope.
086:             */
087:            public void detach() {
088:                if (null != m_val) {
089:                    m_val.allowDetachToRelease(true);
090:                    m_val.detach();
091:                }
092:            }
093:
094:            /** Field m_expression: Stored expression value of this argument.
095:             * @see #setExpression
096:             * @see #getExpression
097:             * */
098:            private String m_expression;
099:
100:            /**
101:             * Get the value expression for this argument.
102:             *
103:             * @return String containing the expression previously stored into this
104:             * argument
105:             * @see #setExpression
106:             */
107:            public String getExpression() {
108:                return m_expression;
109:            }
110:
111:            /**
112:             * Set the value expression for this argument.
113:             *
114:             * @param expr String containing the expression to be stored as this
115:             * argument's value.
116:             * @see #getExpression
117:             */
118:            public void setExpression(String expr) {
119:                m_expression = expr;
120:            }
121:
122:            /** 
123:             * True if this variable was added with an xsl:with-param or
124:             * is added via setParameter.
125:             */
126:            private boolean m_isFromWithParam;
127:
128:            /**
129:             * Tell if this variable is a parameter passed with a with-param or as 
130:             * a top-level parameter.
131:             */
132:            public boolean isFromWithParam() {
133:                return m_isFromWithParam;
134:            }
135:
136:            /** 
137:             * True if this variable is currently visible.  To be visible,
138:             * a variable needs to come either from xsl:variable or be 
139:             * a "received" parameter, ie one for which an xsl:param has
140:             * been encountered.
141:             * Set at the time the object is constructed and updated as needed.
142:             */
143:            private boolean m_isVisible;
144:
145:            /**
146:             * Tell if this variable is currently visible.
147:             */
148:            public boolean isVisible() {
149:                return m_isVisible;
150:            }
151:
152:            /**
153:             * Update visibility status of this variable.
154:             */
155:            public void setIsVisible(boolean b) {
156:                m_isVisible = b;
157:            }
158:
159:            /**
160:             * Construct a dummy parameter argument, with no QName and no
161:             * value (either expression string or value XObject). isVisible
162:             * defaults to true.
163:             */
164:            public Arg() {
165:
166:                m_qname = new QName("");
167:                ; // so that string compares can be done.
168:                m_val = null;
169:                m_expression = null;
170:                m_isVisible = true;
171:                m_isFromWithParam = false;
172:            }
173:
174:            /**
175:             * Construct a parameter argument that contains an expression.
176:             *
177:             * @param qname Name of the argument, expressed as a QName object.
178:             * @param expression String to be stored as this argument's value expression.
179:             * @param isFromWithParam True if this is a parameter variable.
180:             */
181:            public Arg(QName qname, String expression, boolean isFromWithParam) {
182:
183:                m_qname = qname;
184:                m_val = null;
185:                m_expression = expression;
186:                m_isFromWithParam = isFromWithParam;
187:                m_isVisible = !isFromWithParam;
188:            }
189:
190:            /**
191:             * Construct a parameter argument which has an XObject value.
192:             * isVisible defaults to true.
193:             *
194:             * @param qname Name of the argument, expressed as a QName object.
195:             * @param val Value of the argument, expressed as an XObject
196:             */
197:            public Arg(QName qname, XObject val) {
198:
199:                m_qname = qname;
200:                m_val = val;
201:                m_isVisible = true;
202:                m_isFromWithParam = false;
203:                m_expression = null;
204:            }
205:
206:            /**
207:             * Equality function specialized for the variable name.  If the argument 
208:             * is not a qname, it will deligate to the super class.
209:             * 
210:             * @param   obj   the reference object with which to compare.
211:             * @return  <code>true</code> if this object is the same as the obj
212:             *          argument; <code>false</code> otherwise.
213:             */
214:            public boolean equals(Object obj) {
215:                if (obj instanceof  QName) {
216:                    return m_qname.equals(obj);
217:                } else
218:                    return super .equals(obj);
219:            }
220:
221:            /**
222:             * Construct a parameter argument.
223:             *
224:             * @param qname Name of the argument, expressed as a QName object.
225:             * @param val Value of the argument, expressed as an XObject
226:             * @param isFromWithParam True if this is a parameter variable.
227:             */
228:            public Arg(QName qname, XObject val, boolean isFromWithParam) {
229:
230:                m_qname = qname;
231:                m_val = val;
232:                m_isFromWithParam = isFromWithParam;
233:                m_isVisible = !isFromWithParam;
234:                m_expression = null;
235:            }
236:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.