Examples of fromXML()


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

                           name );
        }

        final XStream xstream = new XStream();

        final RuleBase goodRuleBase = (RuleBase) xstream.fromXML( getClass().getResourceAsStream( name ) );

        nodesEquals( ((ReteooRuleBase) goodRuleBase).getRete(),
                     (ruleBase).getRete() );
    }
View Full Code Here

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

        return false;
    }

  public Object readValue(String value) {
    XStream xstream = new XStream();
    return xstream.fromXML(value);
  }

  public String writeValue(Object value) {
    XStream xstream = new XStream();
    return xstream.toXML(value);
View Full Code Here

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

                throws MessagingException {
                try {
                    // Deserialize rmi invocation
                    XStream xstream = new XStream(new DomDriver());
                    SourceTransformer st = new SourceTransformer();
                    Object rmi = xstream.fromXML(st.toString(in.getContent()));

                    DefaultRemoteInvocationExecutor executor = new DefaultRemoteInvocationExecutor();
                    Object result = executor.invoke((RemoteInvocation) rmi, person);

                    // Convert result to an rmi invocation
View Full Code Here

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

        if (log.isDebugEnabled()) {
            log.debug("Remote invocation result: " + result);
        }

        Object obj = xstream.fromXML(result);
        ObjectOutputStream oos = new ObjectOutputStream(os);
        oos.writeObject(obj);
    }
}
View Full Code Here

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

            source.serialize(writer);
            String w = writer.toString();
            // FIXME: a better way to get eliminate param0
            w = w.replaceAll("param0", "xobject");
            w = w.replaceAll("xmlns=\"\"", "");
            mo = (MetaObjectImpl)xs.fromXML(w.trim());
            return mo.getInstance();
        } catch (XMLStreamException e) {

            e.printStackTrace();
        }
View Full Code Here

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

        return null;
    }

    public void toObject(Reader in, Object target) {
        XStream xstream = createXStream();
        xstream.fromXML(in, target);
    }
   
    protected XStream createXStream() {
        return new XStream();
    }
View Full Code Here

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

        throw new IllegalArgumentException("This is not a valid drools model jar - no factmodel.xml found.");
    }

    private Fact[] fromXML(JarInputStream jis) {
        XStream x = new XStream(new DomDriver());
        return (Fact[]) x.fromXML(jis);

    }


}
View Full Code Here

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

  public ArrayList<ProductionData> load(String filename) {
    ArrayList<ProductionData> productionList = new ArrayList<ProductionData>();
    XStream xstream = new XStream();
    try {
      xstream.alias("ProductionData", ProductionData.class);
      productionList = (ArrayList<ProductionData>) xstream.fromXML(new BufferedReader(new InputStreamReader(new FileInputStream(filename))));
    } catch (FileNotFoundException e) {
      logger.debug(e);
    }
    return productionList;
  }
View Full Code Here

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

                xstream = new XStream();
            }

            initXStream(xstream);

            Bif bif = (Bif) xstream.fromXML(is);
            return bif;
        } catch (Exception e) {
            errors.add( new BayesNetworkAssemblerError(resource, "Unable to parse opening Stream:\n" + e.toString()) );
            return null;
        }
View Full Code Here

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

    public static Bif loadBif(URL url) {
        XStream xstream = new XStream();
        initXStream( xstream );

        Bif bif = (Bif) xstream.fromXML(url);
        return bif;
    }

    private static void initXStream(XStream xstream) {
        xstream.processAnnotations(Bif.class);
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.