Examples of fromXML()


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

      return gson.fromJson(entity, Page.class).content;
    case XML:
      XStream xstream = new XStream();
      xstream.alias("page", Page.class);
      xstream.ignoreUnknownElements();
      return ((Page) xstream.fromXML(entity)).content;
    default:
      return entity;
    }
  }
View Full Code Here

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

          WikiPage.class).text;
    case XML:
      XStream xstream = new XStream();
      xstream.alias("wiki_page", WikiPage.class);
      xstream.ignoreUnknownElements();
      return ((WikiPage) xstream.fromXML(entity)).text;
    default:
      return entity;
    }
  }
View Full Code Here

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

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

        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

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

            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

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

        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

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

                        } 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

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

        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

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

   }

   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

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
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.