Package ptolemy.data

Examples of ptolemy.data.XMLToken


                    }
                }
            }
            for (int i = 0; i < input.getWidth(); i++) {
                if (input.hasToken(i)) {
                    XMLToken in = (XMLToken) input.get(i);
                    Document doc = in.getDomTree();

                    try {
                        javax.xml.transform.Source xmlSource = new javax.xml.transform.dom.DOMSource(
                                doc);
                        _transformer.transform(xmlSource, result);

                        if (_debugging) {
                            _debug("--- transform the xmlSource: "
                                    + in.toString() + "\n");
                        }

                        if (out != null) {
                            if (_debugging) {
                                _debug("--- moml change request string: "
                                        + out.toString() + "\n");
                            }

                            StringToken outputToken = new StringToken(out
                                    .toString());
                            output.broadcast(outputToken);

                            if (_debugging) {
                                _debug("--- change request string token "
                                        + "send out. \n");
                            }
                        }
                    } catch (TransformerException ex) {
                        throw new IllegalActionException(this, ex,
                                "Failed  to process '" + in + "'");
                    }

                    try {
                        out.flush();
                        out.close();
                    } catch (IOException ex) {
                        throw new IllegalActionException(this, ex,
                                "Failed  to close or flush '" + out + "'");
                    }
                }
            }
        } else {
            // If there is no transformer, then output the xml string.
            for (int i = 0; i < input.getWidth(); i++) {
                if (input.hasToken(i)) {
                    XMLToken in = (XMLToken) input.get(i);
                    output.broadcast(new StringToken(in.toString()));
                }
            }
        }
    }
View Full Code Here


        }
        outputString = outputString.replace("$inputn", all);
        String ADDheader = headerParameter.stringValue() + "\n";
        ADDheader = ADDheader.concat(outputString);
        try {
            XMLToken out = new XMLToken(ADDheader);
            output.broadcast(out);
        } catch (Exception e) {
            // FIXME: throw an exception that uses "this" so we
            // know in which actor the error is located
            throw new InternalErrorException(e);
View Full Code Here

        for (int i = 0; i < input.getWidth(); i++) {
            if (input.hasToken(i)) {
                StringToken in = (StringToken) input.get(i);

                try {
                    _outToken = new XMLToken(in.stringValue());
                    output.broadcast(_outToken);

                    //k++;
                } catch (java.lang.Exception ex) {
                    throw new IllegalActionException(this, ex,
View Full Code Here

TOP

Related Classes of ptolemy.data.XMLToken

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.