Package com.thoughtworks.xstream

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


                                              String.class );

        ClassLoader cl = ((InternalRuleBase) ((StatefulKnowledgeSessionImpl) ksession).getRuleBase()).getRootClassLoader();
        XStream xstream = BatchExecutionHelper.newXStreamMarshaller();
        xstream.setClassLoader( cl );
        FactHandle factHandle = (FactHandle) ((ExecutionResults) xstream.fromXML( outXml )).getFactHandle( "outStilton" );

        String expectedXml = "";
        expectedXml += "<execution-results>\n";
        expectedXml += "  <result identifier=\"outStilton\">\n";
        expectedXml += "    <org.foo.Whee>\n";
View Full Code Here


        xstream.registerConverter(ROLEMAPCONVERTER);
        xstream.registerConverter(ROLECONVERTER);
        xstream.registerConverter(DICTCONVERTER);
        xstream.aliasType("roles", Map.class);
        try {
            Map<String, RoleImpl> fromXML = (Map<String, RoleImpl>) xstream.fromXML(input);
            m_roles.putAll(fromXML);
        }
        catch (StreamException e) {
            // no problem: this means that the remote repository is empty.
        }
View Full Code Here

            return new SerializedConfigurationMarshaler().readConfigurationData(pushbackInputStream);
        }

        XStream xstream = XStreamUtil.createXStream();
        Reader reader = new InputStreamReader(pushbackInputStream);
        ConfigurationData configurationData = (ConfigurationData)xstream.fromXML(reader);
        return configurationData;
    }

    public void writeConfigurationData(ConfigurationData configurationData, OutputStream out) throws IOException {
        XStream xstream = XStreamUtil.createXStream();
View Full Code Here

        return xStream.toXML(task);
    }

    private Object deserialize(String serializedRunnable) {
        XStream xStream = new XStream();
        return xStream.fromXML(serializedRunnable);
    }

    private void execSQL(String sql) throws SQLException {
        Connection c = dataSource.getConnection();
        try {
View Full Code Here

                        } catch (CannotResolveClassException ignore) {
                        }
                        localXStream.alias(responseAlias, responseClass);
                    }
                    response = responseClass.newInstance();
                    localXStream.fromXML(responseEntity, response);
                } else {
                    // return the response as a stream, for getBlobField
                    response = responseEntity;
                }
                exchange.getOut().setBody(response);
View Full Code Here

        XStream xstream = BatchExecutionHelper.newXStreamMarshaller();
        PersonConverter converter = new PersonConverter();
        xstream.registerConverter( converter );

        ExecutionResults result = (ExecutionResults) xstream.fromXML( outXml );
        Person person = (Person) result.getValue( "salaboy" );
        assertEquals( "salaboy",
                      person.getName() );

        String expectedXml = "";
View Full Code Here

   }

   public org.exoplatform.services.organization.UserProfile getUserProfile()
   {
      XStream xstream = getXStream();
      UserProfileImpl up = (UserProfileImpl)xstream.fromXML(profile);
      return up;
   }

   public void setUserProfile(org.exoplatform.services.organization.UserProfile up)
   {
View Full Code Here

        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

                           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

        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

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.