Source Code Cross Referenced for Pass.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » vdl » classes » 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 » Workflow Engines » pegasus 2.1.0 » org.griphyn.vdl.classes 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file or a portion of this file is licensed under the terms of
003:         * the Globus Toolkit Public License, found in file ../GTPL, or at
004:         * http://www.globus.org/toolkit/download/license.html. This notice must
005:         * appear in redistributions of this file, with or without modification.
006:         *
007:         * Redistributions of this Software, with or without modification, must
008:         * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
009:         * some other similar material which is provided with the Software (if
010:         * any).
011:         *
012:         * Copyright 1999-2004 University of Chicago and The University of
013:         * Southern California. All rights reserved.
014:         */
015:
016:        package org.griphyn.vdl.classes;
017:
018:        import org.griphyn.vdl.classes.*;
019:        import java.io.IOException;
020:        import java.io.Writer;
021:        import java.io.Serializable;
022:
023:        /**
024:         * This class encapsulates a single formal argument that is passed
025:         * from a {@link Derivation} to a {@link Transformation}.
026:         *
027:         * @author Jens-S. Vöckler
028:         * @author Yong Zhao
029:         * @version $Revision: 50 $
030:         *
031:         * @see Value
032:         */
033:        public class Pass extends VDL implements  Cloneable, Serializable {
034:            /**
035:             * Each actual argument must bind to a formal argument. Binding
036:             * is done via the name of the formal argument, as stored in the
037:             * binding variable.
038:             */
039:            private String m_bind;
040:
041:            /**
042:             * Each actual argument does have a value. This attributes store
043:             * the current state of a value.
044:             */
045:            private Value m_value;
046:
047:            /**
048:             * Creates and returns a copy of this object.
049:             * @return a new instance, semi-deep copy
050:             */
051:            public Object clone() {
052:                return new Pass(this .m_bind, (Value) this .m_value.clone());
053:            }
054:
055:            /**
056:             * Ctor.
057:             */
058:            public Pass() {
059:                super ();
060:            }
061:
062:            /**
063:             * Convenience ctor: Establishes a binding with an empty value.
064:             * Note that the value is still null, and must be set explicitely.
065:             *
066:             * @param bind is the name of the formal argument to bind to.
067:             * @see #setValue(Value)
068:             */
069:            public Pass(String bind) {
070:                super ();
071:                this .m_bind = bind;
072:            }
073:
074:            /**
075:             * Convencience ctor: Establishes a binding with a value.
076:             *
077:             * @param bind is the name of the formal argument to bind to.
078:             * @param value is the value to pass to a {@link Transformation}.
079:             */
080:            public Pass(String bind, Value value) {
081:                super ();
082:                this .m_bind = bind;
083:                this .m_value = value;
084:            }
085:
086:            /**
087:             * Accessor: Gets the current bound variable name.
088:             * 
089:             * @return the name of the variable bound to. May return null on an
090:             * default constructed object.
091:             * @see #setBind( java.lang.String )
092:             */
093:            public String getBind() {
094:                return this .m_bind;
095:            }
096:
097:            /**
098:             * Accessor: Gets the current value to be passed. Note that each 
099:             * {@link Value} is either a {@link Scalar} or {@link List}.
100:             *
101:             * @return the value that is to be passed to a {@link Transformation}. 
102:             * @see #setValue( Value )
103:             */
104:            public Value getValue() {
105:                return this .m_value;
106:            }
107:
108:            /**
109:             * Accessor: Sets a new binding with a formal argument.
110:             *
111:             * @param bind is the new binding name.
112:             * @see #getBind()
113:             */
114:            public void setBind(String bind) {
115:                this .m_bind = bind;
116:            }
117:
118:            /**
119:             * Accessor: Sets a new value for a bound variable.
120:             *
121:             * @param value is the new value, which can be a {@link Scalar} or
122:             * a {@link List}.
123:             * @see #getValue()
124:             */
125:            public void setValue(Value value) {
126:                this .m_value = value;
127:            }
128:
129:            /**
130:             * Converts the active state into something meant for human consumption.
131:             * The method will be called when recursively traversing the instance
132:             * tree.
133:             *
134:             * @param stream is a stream opened and ready for writing. This can also
135:             * be a string stream for efficient output.
136:             * @exception IOException if something fishy happens to the stream.
137:             */
138:            public void toString(Writer stream) throws IOException {
139:                // stream.write( escape(this.m_bind) );
140:                stream.write(this .m_bind);
141:                stream.write('=');
142:                this .m_value.toString(stream);
143:            }
144:
145:            /**
146:             * Dump the state of the current element as XML output. This function
147:             * traverses all sibling classes as necessary, and converts the data
148:             * into pretty-printed XML output. The stream interface should be able
149:             * to handle large output efficiently, if you use a buffered writer.
150:             *
151:             * @param stream is a stream opened and ready for writing. This can also
152:             * be a string stream for efficient output.
153:             * @param indent is a <code>String</code> of spaces used for pretty
154:             * printing. The initial amount of spaces should be an empty string.
155:             * The parameter is used internally for the recursive traversal.
156:             * @param namespace is the XML schema namespace prefix. If neither
157:             * empty nor null, each element will be prefixed with this prefix,
158:             * and the root element will map the XML namespace. 
159:             * @exception IOException if something fishy happens to the stream.
160:             */
161:            public void toXML(Writer stream, String indent, String namespace)
162:                    throws IOException {
163:                String tag = (namespace != null && namespace.length() > 0) ? namespace
164:                        + ":pass"
165:                        : "pass";
166:                String newline = System.getProperty("line.separator", "\r\n");
167:
168:                // open tag
169:                if (indent != null && indent.length() > 0)
170:                    stream.write(indent);
171:                stream.write('<');
172:                stream.write(tag);
173:                writeAttribute(stream, " bind=\"", this .m_bind);
174:                stream.write('>');
175:                if (indent != null)
176:                    stream.write(newline);
177:
178:                // write content
179:                String newindent = indent == null ? null : indent + "  ";
180:                this .m_value.toXML(stream, newindent, namespace);
181:
182:                // close tag
183:                if (indent != null && indent.length() > 0)
184:                    stream.write(indent);
185:                stream.write("</");
186:                stream.write(tag);
187:                stream.write('>');
188:                if (indent != null)
189:                    stream.write(newline);
190:            }
191:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.