Source Code Cross Referenced for ArgString.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » vdl » invocation » 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.invocation 
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:        package org.griphyn.vdl.invocation;
016:
017:        import java.util.*;
018:        import java.io.Writer;
019:        import java.io.IOException;
020:
021:        /**
022:         * This class maintains the application that was run, and the
023:         * arguments to the commandline that were actually passed on to
024:         * the application.
025:         *
026:         * @author Jens-S. Vöckler
027:         * @author Yong Zhao
028:         * @version $Revision: 50 $
029:         * @see Job
030:         */
031:        public class ArgString extends Arguments implements  HasText {
032:            /**
033:             * This is the data contained between the tags. There may be
034:             * no data. 
035:             */
036:            private StringBuffer m_value;
037:
038:            /**
039:             * Default c'tor: Construct a hollow shell and allow further
040:             * information to be added later.
041:             */
042:            public ArgString() {
043:                super ();
044:                m_value = null;
045:            }
046:
047:            /**
048:             * Constructs an applications without arguments.
049:             * @param executable is the name of the application.
050:             */
051:            public ArgString(String executable) {
052:                super (executable);
053:                m_value = null;
054:            }
055:
056:            /**
057:             * Constructs an applications with arguments.
058:             * @param executable is the name of the application.
059:             * @param value represents the argument line passed.
060:             */
061:            public ArgString(String executable, String value) {
062:                super (executable);
063:                m_value = new StringBuffer(value);
064:            }
065:
066:            /**
067:             * Appends a piece of text to the existing text. 
068:             * @param fragment is a piece of text to append to existing text.
069:             * Appending <code>null</code> is a noop.
070:             */
071:            public void appendValue(String fragment) {
072:                if (fragment != null) {
073:                    if (this .m_value == null)
074:                        this .m_value = new StringBuffer(fragment);
075:                    else
076:                        this .m_value.append(fragment);
077:                }
078:            }
079:
080:            /**
081:             * Accessor
082:             *
083:             * @see #setValue(String)
084:             */
085:            public String getValue() {
086:                return (m_value == null ? null : m_value.toString());
087:            }
088:
089:            /**
090:             * Accessor.
091:             *
092:             * @param value is the new value to set.
093:             * @see #getValue()
094:             */
095:            public void setValue(String value) {
096:                this .m_value = (value == null ? null : new StringBuffer(value));
097:            }
098:
099:            /**
100:             * Dumps the state of the current element as XML output. This function
101:             * can return the necessary data more efficiently, thus overwriting
102:             * the inherited method.
103:             *
104:             * @param indent is a <code>String</code> of spaces used for pretty
105:             * printing. The initial amount of spaces should be an empty string.
106:             * The parameter is used internally for the recursive traversal.
107:             *
108:             * @return a String which contains the state of the current class and
109:             * its siblings using XML. Note that these strings might become large.
110:             */
111:            public String toXML(String indent) {
112:                StringBuffer result = new StringBuffer(64);
113:
114:                result.append("<arguments");
115:                if (m_executable != null) {
116:                    result.append(" executable=\"");
117:                    result.append(quote(m_executable, true));
118:                    result.append('"');
119:                }
120:
121:                if (m_value == null) {
122:                    // no content
123:                    result.append("/>");
124:                } else {
125:                    // yes, content
126:                    result.append('>');
127:                    result.append(quote(getValue(), false));
128:                    result.append("</arguments>");
129:                }
130:
131:                return result.toString();
132:            }
133:
134:            /**
135:             * Dump the state of the current element as XML output. This function
136:             * traverses all sibling classes as necessary, and converts the data
137:             * into pretty-printed XML output. The stream interface should be able
138:             * to handle large output efficiently.
139:             *
140:             * @param stream is a stream opened and ready for writing. This can also
141:             * be a string stream for efficient output.
142:             * @param indent is a <code>String</code> of spaces used for pretty
143:             * printing. The initial amount of spaces should be an empty string.
144:             * The parameter is used internally for the recursive traversal.
145:             * If a <code>null</code> value is specified, no indentation nor
146:             * linefeeds will be generated. 
147:             * @param namespace is the XML schema namespace prefix. If neither
148:             * empty nor null, each element will be prefixed with this prefix,
149:             * and the root element will map the XML namespace. 
150:             * @exception IOException if something fishy happens to the stream.
151:             */
152:            public void toXML(Writer stream, String indent, String namespace)
153:                    throws IOException {
154:                String tag = (namespace != null && namespace.length() > 0) ? namespace
155:                        + ":arguments"
156:                        : "arguments";
157:
158:                // open tag
159:                if (indent != null && indent.length() > 0)
160:                    stream.write(indent);
161:                stream.write('<');
162:                stream.write(tag);
163:                if (m_executable != null)
164:                    writeAttribute(stream, " executable=\"", m_executable);
165:
166:                if (m_value != null) {
167:                    // yes, content
168:                    stream.write('>');
169:                    stream.write(quote(getValue(), false));
170:                    stream.write("</");
171:                    stream.write(tag);
172:                    stream.write('>');
173:                } else {
174:                    // no content
175:                    stream.write("/>");
176:                }
177:                if (indent != null)
178:                    stream.write(System.getProperty("line.separator", "\r\n"));
179:            }
180:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.