Package com.thoughtworks.xstream

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


    for (Class type : typesToEnhance) {
      xstream.addImplicitCollection(enhancedType, "elements", xstream.getMapper().serializedClass(type), type);
    }

    for (Class customType : realTypes.values()) {
      xstream.addImplicitCollection(customType, "link", "link", DefaultRelation.class);
    }

    return xstream;
  }
View Full Code Here


        // XStream xstream = new XStream( new JettisonMappedXmlDriver() );
        XStream xstream = new XStream();
        // xstream.setMode( XStream.NO_REFERENCES );
        xstream.processAnnotations( BatchExecutionImpl.class );
        xstream.addImplicitCollection( BatchExecutionImpl.class,
                                       "commands" );

        xstream.alias( "batch-execution",
                       BatchExecutionImpl.class );
        xstream.alias( "insert",
View Full Code Here

    @Override
    protected List<InternalRule> loadRulesFromExternal() throws IOException {
        XStream xstream = new XStream();
        xstream.alias("rules", InternalRules.class);
        xstream.alias("rule", InternalRule.class);
        xstream.addImplicitCollection(InternalRules.class, "rules");
        xstream.useAttributeFor(InternalRule.class, "merger");

        List<InternalRule> rules = new ArrayList<InternalRule>();

        if (getConfigLocation() != null) {
View Full Code Here

                                          Set<IRoutingRule<IBatisRoutingFact, List<String>>> namespaceRules)
            throws IOException {
        XStream xstream = new XStream();
        xstream.alias("rules", InternalRules.class);
        xstream.alias("rule", InternalRule.class);
        xstream.addImplicitCollection(InternalRules.class, "rules");
        xstream.useAttributeFor(InternalRule.class, "merger");

        InternalRules internalRules = (InternalRules) xstream.fromXML(configLocation
                .getInputStream());
        List<InternalRule> rules = internalRules.getRules();
View Full Code Here

    public static void main(String[] args) {
        XStream xstream = new XStream();
        xstream.alias("rules", InternalRules.class);
        xstream.alias("rule", InternalRule.class);
        xstream.addImplicitCollection(InternalRules.class, "rules");
        xstream.useAttributeFor(InternalRule.class, "merger");

        InternalRules rules = new InternalRules();
        List<InternalRule> rList = new ArrayList<InternalRule>();
        InternalRule r1 = new InternalRule();
View Full Code Here

     */
    static XStream buildXStream() {
        XStream xstream = new XStream();
        xstream.alias("OgrConfiguration", OgrConfiguration.class);
        xstream.alias("Format", OgrFormat.class);
        xstream.addImplicitCollection(OgrFormat.class, "options", "option", String.class);
        return xstream;
    }

    /**
     * Kill all threads on web app context shutdown to avoid permgen leaks
View Full Code Here

    for (String name : collectionNames) {
      xstream.alias(name, enhancedType);
    }

    for (Class type : typesToEnhance) {
      xstream.addImplicitCollection(enhancedType, "elements", xstream.getMapper().serializedClass(type), type);
    }

    for (Class customType : realTypes.values()) {
      xstream.addImplicitCollection(customType, "link", "link", DefaultRelation.class);
    }
View Full Code Here

    for (Class type : typesToEnhance) {
      xstream.addImplicitCollection(enhancedType, "elements", xstream.getMapper().serializedClass(type), type);
    }

    for (Class customType : realTypes.values()) {
      xstream.addImplicitCollection(customType, "link", "link", DefaultRelation.class);
    }

    return xstream;
  }
View Full Code Here

     */
    static XStream buildXStream() {
        XStream xstream = new XStream();
        xstream.alias("OgrConfiguration", OgrConfiguration.class);
        xstream.alias("Format", OgrFormat.class);
        xstream.addImplicitCollection(OgrFormat.class, "options", "option", String.class);
        return xstream;
    }
   
    private class ConfigurationPoller extends TimerTask {
        Long lastModified = null;
View Full Code Here

    @Test
    public void shouldParseABibliographyFromXML() throws Exception {

        XStream xstream = new XStream();
        xstream.addImplicitCollection(Bibliography.class, "entries");
        xstream.alias("bibliography", Bibliography.class);
        xstream.alias("bibliography-entry", BibliographyEntry.class);

        Bibliography bibliography = (Bibliography) xstream.fromXML(new File(
                "src/test/resources/bibliography/bib.xml"));
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.