Index: src/nongnu/cashews/eclipse/gui/Cashews.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/gui/Cashews.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 Cashews.java --- src/nongnu/cashews/eclipse/gui/Cashews.java 11 May 2005 07:16:05 -0000 1.1 +++ src/nongnu/cashews/eclipse/gui/Cashews.java 13 May 2005 01:29:59 -0000 @@ -62,7 +62,12 @@ public class Cashews { public void widgetSelected(SelectionEvent e) { - new WizardDialog(getShell(), new CashewsWizard()).open(); + CashewsWizard wizard = new CashewsWizard(); + new WizardDialog(getShell(), wizard).open(); + SoapClient client = new SoapClient(); + SoapOperation operation = getService(); + client.call(operation, new URI("testWorkflow3"), + TEST_COMPOSITE_SEQUENCE); } }); return button; Index: src/nongnu/cashews/eclipse/gui/CashewsWizard.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/gui/CashewsWizard.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 CashewsWizard.java --- src/nongnu/cashews/eclipse/gui/CashewsWizard.java 11 May 2005 07:16:05 -0000 1.1 +++ src/nongnu/cashews/eclipse/gui/CashewsWizard.java 13 May 2005 01:29:59 -0000 @@ -48,6 +48,7 @@ public class CashewsWizard { super(); setNeedsProgressMonitor(true); + setWindowTitle("CASheW-s"); try { cp = new CompositeProcess("CompProc"); @@ -65,7 +66,7 @@ public class CashewsWizard { addPage(new CompositeChoicePage()); addPage(new OperationChoicePage()); - addPage(new ConnectionPage()); + //addPage(new ConnectionPage()); } /** @@ -75,7 +76,10 @@ public class CashewsWizard */ public boolean performFinish() { - return true; + if (cp.getControlStructure() != null) + return true; + else + return false; } /** Index: src/nongnu/cashews/eclipse/gui/CompositeChoicePage.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/gui/CompositeChoicePage.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 CompositeChoicePage.java --- src/nongnu/cashews/eclipse/gui/CompositeChoicePage.java 11 May 2005 07:16:05 -0000 1.1 +++ src/nongnu/cashews/eclipse/gui/CompositeChoicePage.java 13 May 2005 01:29:59 -0000 @@ -46,6 +46,9 @@ public class CompositeChoicePage extends WizardPage { + /** + * The list of composite process types. + */ private List list; /** Index: src/nongnu/cashews/eclipse/gui/ConnectionPage.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/gui/ConnectionPage.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 ConnectionPage.java --- src/nongnu/cashews/eclipse/gui/ConnectionPage.java 11 May 2005 07:16:05 -0000 1.1 +++ src/nongnu/cashews/eclipse/gui/ConnectionPage.java 13 May 2005 01:29:59 -0000 @@ -49,6 +49,7 @@ import org.eclipse.swt.events.SelectionE import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.List; @@ -64,6 +65,8 @@ public class ConnectionPage extends WizardPage { + List list1, list2; + /** * The map of strings in the list to performances. */ @@ -89,28 +92,33 @@ public class ConnectionPage layout.justify = true; layout.fill = false; container.setLayout(layout); - List list1 = new List(container, SWT.CENTER | SWT.SINGLE); - List list2 = new List(container, SWT.CENTER | SWT.SINGLE); + list1 = new List(container, SWT.CENTER | SWT.SINGLE); + list2 = new List(container, SWT.CENTER | SWT.SINGLE); performanceMap = new HashMap(); - /* - CashewsWizard wizard = (CashewsWizard) getWizard(); + setControl(container); + setPageComplete(true); + } + + public Control getControl() + { + CashewsWizard wizard = (CashewsWizard) getWizard(); MultiPerform mp = (MultiPerform) wizard.getProcess().getControlStructure(); - for (MultiPerformElement e : mp.getContent()) + if (mp != null) { - Performance p = (Performance) e; - String name = p.getName().toString(); - AtomicProcess ap = (AtomicProcess) p.getProcess(); - SoapOperation op = (SoapOperation) ap.getGrounding(); - String endpoint = op.getEndpoint().toString(); - String listString = name + ":" + endpoint; - list1.add(listString); - list2.add(listString); - performanceMap.put(listString, p); + for (MultiPerformElement e : mp.getContent()) + { + Performance p = (Performance) e; + String name = p.getName().toString(); + AtomicProcess ap = (AtomicProcess) p.getProcess(); + SoapOperation op = (SoapOperation) ap.getGrounding(); + String endpoint = op.getEndpoint().toString(); + String listString = name + ":" + endpoint; + list1.add(listString); + list2.add(listString); + performanceMap.put(listString, p); + } } - */ - setControl(container); - setPageComplete(false); + return super.getControl(); } - } Index: src/nongnu/cashews/eclipse/gui/OperationChoicePage.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/gui/OperationChoicePage.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 OperationChoicePage.java --- src/nongnu/cashews/eclipse/gui/OperationChoicePage.java 11 May 2005 07:16:05 -0000 1.1 +++ src/nongnu/cashews/eclipse/gui/OperationChoicePage.java 13 May 2005 01:29:59 -0000 @@ -29,12 +29,15 @@ import java.net.URISyntaxException; import java.util.HashMap; import java.util.Map; import java.util.logging.ConsoleHandler; +import java.util.logging.Handler; +import java.util.logging.Level; import nongnu.cashews.language.process.AtomicProcess; import nongnu.cashews.language.process.MultiPerform; import nongnu.cashews.language.process.Performance; import nongnu.cashews.language.grounding.SoapOperation; + import nongnu.cashews.wsdl.WsdlParser; import org.eclipse.core.runtime.Status; @@ -109,7 +112,9 @@ public class OperationChoicePage + dialog.getFileName(); try { - WsdlParser parser = new WsdlParser(new ConsoleHandler()); + Handler handler = new ConsoleHandler(); + handler.setLevel(Level.FINE); + WsdlParser parser = new WsdlParser(handler); parser.parse(new File(filename)); for (SoapOperation op: parser.getWsdlHandler().getOperations()) { Index: src/nongnu/cashews/services/Input.java =================================================================== RCS file: src/nongnu/cashews/services/Input.java diff -N src/nongnu/cashews/services/Input.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/nongnu/cashews/services/Input.java 13 May 2005 01:29:59 -0000 @@ -0,0 +1,86 @@ +/* Input.java -- Input class for a key-value pair service. + Copyright (C) 2005 The University of Sheffield. + + This file is part of the CASheW-s editor. + + The CASheW-s editor is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + The CASheW-s editor is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with The CASheW-s editor; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. +*/ + +package nongnu.cashews.services; + +/** + * Represents an input in a key-value pair service. + * + * @author Andrew John Hughes (address@hidden) + */ +public class Input +{ + + /** + * The name of the input. + */ + private String name; + + /** + * The value of the input. + */ + private String value; + + /** + * Constructs a new input. + */ + public Input(String name, String value) + { + setName(name); + setValue(value); + } + + /** + * Sets the name to that specified. + * + * @param name the new name. + */ + public void setName(String name) + { + this.name = name; + } + + /** + * Sets the value to that specified. + * + * @param value the new value. + */ + public void setValue(String value) + { + this.value = value; + } + + /** + * Returns a String representation of this performance. + * + * @return a textual representation. + */ + public String toString() + { + return getClass().getName() + + "[name=" + + name + + ",value=" + + value + + "]"; + } + +} Index: src/nongnu/cashews/services/KeyValueService.java =================================================================== RCS file: src/nongnu/cashews/services/KeyValueService.java diff -N src/nongnu/cashews/services/KeyValueService.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/nongnu/cashews/services/KeyValueService.java 13 May 2005 01:29:59 -0000 @@ -0,0 +1,91 @@ +/* KeyValueService.java -- The CASheW-s key-value service. + Copyright (C) 2005 The University of Sheffield. + + This file is part of the CASheW-s editor. + + The CASheW-s editor is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + The CASheW-s editor is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with The CASheW-s editor; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. +*/ + +package nongnu.cashews.services; + +import java.io.IOException; + +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; + +import java.util.LinkedList; +import java.util.List; + +import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI; + +import nongnu.cashews.language.grounding.MessagePart; +import nongnu.cashews.language.grounding.SoapMessage; +import nongnu.cashews.language.grounding.SoapOperation; + +import nongnu.cashews.soap.SoapClient; + +/** + * Represents the CASheW-s key-value service. + * + * @author Andrew John Hughes (address@hidden) + */ +public class KeyValueService +{ + + public static SoapOperation getService(String endpoint) + throws URISyntaxException + { + SoapOperation operation = new SoapOperation(endpoint); + SoapMessage input = new SoapMessage(null, "execRequest"); + MessagePart part1 = new MessagePart("input"); + part1.setName(null, "input"); + part1.setType(W3C_XML_SCHEMA_NS_URI, "string", "xsd"); + input.addPart(part1); + operation.setInputMessage(input); + return operation; + } + + /** + * Test harness which performs a workflow request with a test + * composite process. + * + * @param args the command-line arguments. + * @throws IOException if an I/O error occurs. + * @throws URISyntaxException if one of the operation URIs is invalid. + * @throws MalformedURLException if the endpoint URL is invalid. + * @throws InstantiationException if a needed class can't be instantiated. + * @throws IllegalAccessException if a needed class can't be accessed. + * @throws ClassNotFoundException if a needed class can't be found. + */ + public static void main(String[] args) + throws URISyntaxException, MalformedURLException, IOException, + InstantiationException, IllegalAccessException, + ClassNotFoundException + { + SoapClient client = new SoapClient(); + SoapOperation operation = getService(args[0]); + List inputs = new LinkedList(); + for (int a = 1; a < args.length; ++a) + { + String[] parts = args[a].split("="); + Input input = new Input(parts[0],parts[1]); + inputs.add(input); + } + client.call(operation, inputs); + } + +} Index: src/nongnu/cashews/services/TypeChecker.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/services/TypeChecker.java,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 TypeChecker.java --- src/nongnu/cashews/services/TypeChecker.java 8 May 2005 12:03:41 -0000 1.2 +++ src/nongnu/cashews/services/TypeChecker.java 13 May 2005 01:29:59 -0000 @@ -25,10 +25,16 @@ import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; -/* FIXME: COMMENTED OUT UNTIL IT WORKS WITHIN THE PROJECT -import org.apache.axis.client.Call; -import org.apache.axis.client.Service; -*/ +import java.net.MalformedURLException; +import java.net.URISyntaxException; + +import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI; + +import nongnu.cashews.language.grounding.MessagePart; +import nongnu.cashews.language.grounding.SoapMessage; +import nongnu.cashews.language.grounding.SoapOperation; + +import nongnu.cashews.soap.SoapClient; /** * A client implementation to call the type checking web service. @@ -50,9 +56,16 @@ public class TypeChecker * * @param args the command-line arguments. * @throws IOException if an I/O error occurs. + * @throws URISyntaxException if one of the operation URIs is invalid. + * @throws MalformedURLException if the endpoint URL is invalid. + * @throws InstantiationException if a needed class can't be instantiated. + * @throws IllegalAccessException if a needed class can't be accessed. + * @throws ClassNotFoundException if a needed class can't be found. */ public static void main(String[] args) - throws IOException + throws URISyntaxException, MalformedURLException, IOException, + InstantiationException, IllegalAccessException, + ClassNotFoundException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); @@ -62,12 +75,11 @@ public class TypeChecker expression = br.readLine(); - /* FIXME: COMMENTED OUT UNTIL IT WORKS WITHIN THE PROJECT boolean flag = new TypeChecker().callService(expression); if( flag == false ) System.out.println( "Invalid expression" ); - */ + } @@ -78,12 +90,29 @@ public class TypeChecker * * @param expression the expression to supply to the service. * @return true if the code typed correctly, false otherwise. + * @throws IOException if an I/O error occurs. + * @throws URISyntaxException if one of the operation URIs is invalid. + * @throws MalformedURLException if the endpoint URL is invalid. + * @throws InstantiationException if a needed class can't be instantiated. + * @throws IllegalAccessException if a needed class can't be accessed. + * @throws ClassNotFoundException if a needed class can't be found. */ - /* FIXME: COMMENTED OUT UNTIL IT WORKS WITHIN THE PROJECT public boolean callService( String expression ) + throws URISyntaxException, MalformedURLException, IOException, + InstantiationException, IllegalAccessException, + ClassNotFoundException { - try - { + SoapOperation operation = new SoapOperation(TEST_ENDPOINT); + SoapMessage input = new SoapMessage(null, "typeCheckRequest"); + MessagePart part1 = new MessagePart("expr"); + part1.setName(null, "expr"); + part1.setType(W3C_XML_SCHEMA_NS_URI, "string", "xsd"); + input.addPart(part1); + operation.setInputMessage(input); + SoapClient client = new SoapClient(); + Boolean b = (Boolean) client.call(operation, expression); + return b; + /* Axis code Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress( new java.net.URL(TEST_ENDPOINT) ); @@ -110,6 +139,7 @@ public class TypeChecker e.printStackTrace(); return false; } + */ } - */ + } Index: src/nongnu/cashews/services/WorkflowService.java =================================================================== RCS file: src/nongnu/cashews/services/WorkflowService.java diff -N src/nongnu/cashews/services/WorkflowService.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/nongnu/cashews/services/WorkflowService.java 13 May 2005 01:29:59 -0000 @@ -0,0 +1,87 @@ +/* WorkflowService.java -- The CASheW-s workflow service. + Copyright (C) 2005 The University of Sheffield. + + This file is part of the CASheW-s editor. + + The CASheW-s editor is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + The CASheW-s editor is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with The CASheW-s editor; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. +*/ + +package nongnu.cashews.services; + +import java.io.IOException; + +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; + +import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI; + +import nongnu.cashews.language.grounding.MessagePart; +import nongnu.cashews.language.grounding.SoapMessage; +import nongnu.cashews.language.grounding.SoapOperation; + +import static nongnu.cashews.services.Processes.TEST_COMPOSITE_SEQUENCE; + +import nongnu.cashews.soap.SoapClient; + +/** + * Represents the CASheW-s workflow service. + * + * @author Andrew John Hughes (address@hidden) + */ +public class WorkflowService +{ + + public static SoapOperation getService() + throws URISyntaxException + { + SoapOperation operation = new SoapOperation + ("http://repton.no-ip.com:8080/workflowService"); + SoapMessage input = new SoapMessage(null, "workflowRequest"); + MessagePart part1 = new MessagePart("endpoint"); + part1.setName(null, "endpoint"); + part1.setType(W3C_XML_SCHEMA_NS_URI, "anyURI", "xsd"); + MessagePart part2 = new MessagePart("process"); + part2.setName(null, "process"); + input.addPart(part1); + input.addPart(part2); + operation.setInputMessage(input); + return operation; + } + + /** + * Test harness which performs a workflow request with a test + * composite process. + * + * @param args the command-line arguments. + * @throws IOException if an I/O error occurs. + * @throws URISyntaxException if one of the operation URIs is invalid. + * @throws MalformedURLException if the endpoint URL is invalid. + * @throws InstantiationException if a needed class can't be instantiated. + * @throws IllegalAccessException if a needed class can't be accessed. + * @throws ClassNotFoundException if a needed class can't be found. + */ + public static void main(String[] args) + throws URISyntaxException, MalformedURLException, IOException, + InstantiationException, IllegalAccessException, + ClassNotFoundException + { + SoapClient client = new SoapClient(); + SoapOperation operation = getService(); + client.call(operation, new URI("testWorkflow3"), TEST_COMPOSITE_SEQUENCE); + } + +} Index: src/nongnu/cashews/soap/SoapClient.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/soap/SoapClient.java,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 SoapClient.java --- src/nongnu/cashews/soap/SoapClient.java 10 May 2005 23:42:47 -0000 1.2 +++ src/nongnu/cashews/soap/SoapClient.java 13 May 2005 01:30:00 -0000 @@ -29,21 +29,15 @@ import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URI; import java.util.List; -import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI; - import static nongnu.cashews.commons.Configuration.CASHEWS_VERSION; import nongnu.cashews.language.grounding.MessagePart; import nongnu.cashews.language.grounding.SoapMessage; import nongnu.cashews.language.grounding.SoapOperation; -import static nongnu.cashews.services.Processes.TEST_COMPOSITE_SEQUENCE; - import nongnu.cashews.xml.Serializer; import nongnu.cashews.xml.schema.TypeMapper; @@ -91,6 +85,7 @@ public class SoapClient connection.connect(); /* System.out.println(connection.getContent()); + */ InputStream istream = connection.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(istream)); String line = reader.readLine(); @@ -99,6 +94,7 @@ public class SoapClient System.out.println(line); line = reader.readLine(); } + /* return null; */ if (connection.getResponseCode() == 200) @@ -148,36 +144,4 @@ public class SoapClient return Serializer.finalizeXmlDocument(document, env, null); } - /** - * Test harness which performs a workflow request with a test - * composite process. - * - * @param args the command-line arguments. - * @throws IOException if an I/O error occurs. - * @throws URISyntaxException if one of the operation URIs is invalid. - * @throws MalformedURLException if the endpoint URL is invalid. - * @throws InstantiationException if a needed class can't be instantiated. - * @throws IllegalAccessException if a needed class can't be accessed. - * @throws ClassNotFoundException if a needed class can't be found. - */ - public static void main(String[] args) - throws URISyntaxException, MalformedURLException, IOException, - InstantiationException, IllegalAccessException, - ClassNotFoundException - { - SoapClient client = new SoapClient(); - SoapOperation operation = new SoapOperation - ("http://repton.no-ip.com:8080/workflowService"); - SoapMessage input = new SoapMessage(null, "workflowRequest"); - MessagePart part1 = new MessagePart("endpoint"); - part1.setName(null, "endpoint"); - part1.setType(W3C_XML_SCHEMA_NS_URI, "anyURI", "xsd"); - MessagePart part2 = new MessagePart("process"); - part2.setName(null, "process"); - input.addPart(part1); - input.addPart(part2); - operation.setInputMessage(input); - client.call(operation, new URI("testWorkflow3"), TEST_COMPOSITE_SEQUENCE); - } - } Index: src/nongnu/cashews/wsdl/WsdlHandler.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/wsdl/WsdlHandler.java,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 WsdlHandler.java --- src/nongnu/cashews/wsdl/WsdlHandler.java 10 May 2005 23:42:47 -0000 1.2 +++ src/nongnu/cashews/wsdl/WsdlHandler.java 13 May 2005 01:30:00 -0000 @@ -51,7 +51,7 @@ import org.xml.sax.SAXException; * SoapOperation objects. * * @author Andrew John Hughes (address@hidden) - * @see nongnu.cashews.langauge.grounding.SoapOperation + * @see nongnu.cashews.language.grounding.SoapOperation */ public class WsdlHandler extends XmlBaseHandler @@ -382,8 +382,9 @@ public class WsdlHandler */ public void endDocument() { - for (SoapOperation op : operationMap.values()) - operations.add(op); + if (operationMap != null) + for (SoapOperation op : operationMap.values()) + operations.add(op); } } Index: src/nongnu/cashews/xml/schema/TypeMapper.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/xml/schema/TypeMapper.java,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 TypeMapper.java --- src/nongnu/cashews/xml/schema/TypeMapper.java 7 May 2005 21:22:54 -0000 1.2 +++ src/nongnu/cashews/xml/schema/TypeMapper.java 13 May 2005 01:30:00 -0000 @@ -31,6 +31,7 @@ import javax.xml.namespace.QName; import nongnu.cashews.xml.schema.datatypes.AnyUri; import nongnu.cashews.xml.schema.datatypes.Int; import nongnu.cashews.xml.schema.datatypes.XsdQName; +import nongnu.cashews.xml.schema.datatypes.XsdString; /** * Maps a Java data type to an XML schema data type. @@ -54,6 +55,7 @@ public class TypeMapper builtInTypes.put(URI.class, new AnyUri()); builtInTypes.put(QName.class, new XsdQName()); builtInTypes.put(Integer.class, new Int()); + builtInTypes.put(String.class, new XsdString()); } /** Index: src/nongnu/cashews/xml/schema/datatypes/XsdString.java =================================================================== RCS file: src/nongnu/cashews/xml/schema/datatypes/XsdString.java diff -N src/nongnu/cashews/xml/schema/datatypes/XsdString.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/nongnu/cashews/xml/schema/datatypes/XsdString.java 13 May 2005 01:30:00 -0000 @@ -0,0 +1,50 @@ +/* XsdString.java -- Represents the XML schema type, xsd:string. + Copyright (C) 2005 The University of Sheffield. + + This file is part of the CASheW-s editor. + + The CASheW-s editor is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + The CASheW-s editor is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with The CASheW-s editor; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. +*/ + +package nongnu.cashews.xml.schema.datatypes; + +import nongnu.cashews.xml.schema.XsdType; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; + +/** + * Represents the XML schema datatype, xsd:string. + * + * @author Andrew John Hughes (address@hidden) + */ +public class XsdString + implements XsdType +{ + + /** + * Translates the supplied Java String into a value + * of the XML schema datatype, xsd:string. + * @param document the XML document to use to create the XML tree. + * @param value the URI value to translate. + * @return an XML tree node representing the type. + */ + public Node translateValue(Document document, String value) + { + return document.createTextNode(value); + } + +}