Package com.thoughtworks.xstream

Examples of com.thoughtworks.xstream.XStream.alias()


                       SetGlobalCommand.class );
        xstream.alias( "get-global",
                       GetGlobalCommand.class );       
        xstream.alias( "batch-execution-results", BatchExecutionResultImpl.class );
        xstream.alias( "query-results", FlatQueryResults.class );
        xstream.alias( "query-results", NativeQueryResults.class );

        xstream.registerConverter( new InsertConverter( xstream.getMapper() ) );
        xstream.registerConverter( new InsertElementsConverter( xstream.getMapper() ) );
        xstream.registerConverter( new StartProcessConvert( xstream.getMapper() ) );
        xstream.registerConverter( new QueryConverter( xstream.getMapper() ) );
View Full Code Here


    }

    public String toString() {
        Writer w = new StringWriter();
        XStream xstream = new XStream(new DomDriver());
        xstream.alias("person", PersonImpl.class);
        xstream.aliasField("given-name", PersonImpl.class, "givenName");
        xstream.aliasField("sur-name", PersonImpl.class, "surName");
        xstream.toXML(this, w);
        return w.toString();
    }
View Full Code Here

    PullTransformer<OMElement, XObject> {

    public XObject transform(OMElement source, TransformationContext context) {

        XStream xs = new XStream();
        xs.alias("xobject", MetaObjectImpl.class);
        MetaObjectImpl mo;
        try {
            java.io.StringWriter writer = new StringWriter();
            source.serialize(writer);
            String w = writer.toString();
View Full Code Here

        try {
            MetaObject mj = new MetaObjectImpl(source);
            Document root = DOMHelper.newDocument();
            DomWriter out = new DomWriter(DOMHelper.newDocument());
            XStream xs = new XStream();
            xs.alias("xobject", mj.getClass());
            xs.marshal(source, out);
            DOMHelper.adjustElementName(context, root.getDocumentElement());
            return root;
        } catch (Exception e) {
            throw new TransformationException(e);
View Full Code Here

    public OMElement transform(XObject source, TransformationContext context) {
        MetaObject mj = new MetaObjectImpl(source);
        OMElement element = null;
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        XStream xs = new XStream();
        xs.alias("xobject", mj.getClass());
        xs.toXML(mj, out);
        /* TODO: Maybe a base64 conversion...? or not?
         *  ie. new ByteArrayInputStream(Utils.toBase64(out.toByteArray()).getBytes())
         */
        try {
View Full Code Here

            if ( list.size() > 0 )
            {
                Object elt = list.iterator().next();

                String name = StringUtils.lowercaseFirstLetter( ClassUtils.getShortClassName( elt.getClass() ) );
                currentXStream.alias( pluralize( name ), List.class );
            }
            else
            {
                // try to detect the alias from question
                if ( expr.indexOf( '.' ) != -1 )
View Full Code Here

            {
                // try to detect the alias from question
                if ( expr.indexOf( '.' ) != -1 )
                {
                    String name = expr.substring( expr.indexOf( '.' ) + 1, expr.indexOf( '}' ) );
                    currentXStream.alias( name, List.class );
                }
            }
        }

        return currentXStream.toXML( obj );
View Full Code Here

    public void writeReport(OutputStream out,
                            VerifierReport result) throws IOException {
        XStream xstream = new XStream();

        xstream.alias( "result",
                       VerifierReport.class );
        xstream.alias( "message",
                       VerifierMessage.class );

        xstream.alias( "Gap",
View Full Code Here

                            VerifierReport result) throws IOException {
        XStream xstream = new XStream();

        xstream.alias( "result",
                       VerifierReport.class );
        xstream.alias( "message",
                       VerifierMessage.class );

        xstream.alias( "Gap",
                       Gap.class );
        xstream.alias( "MissingNumber",
View Full Code Here

        xstream.alias( "result",
                       VerifierReport.class );
        xstream.alias( "message",
                       VerifierMessage.class );

        xstream.alias( "Gap",
                       Gap.class );
        xstream.alias( "MissingNumber",
                       MissingNumberPattern.class );

        xstream.alias( "Field",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.