Package com.thoughtworks.xstream

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


            throw new IllegalArgumentException("at least one of the streams is null");
        }
        XStream xstream = new XStream();
        xstream.aliasPackage("config", ProcessDefinitionConfig.class.getPackage().getName());
        xstream.useAttributeFor(String.class);
        xstream.useAttributeFor(Boolean.class);
        xstream.useAttributeFor(Integer.class);

        ProcessDefinitionConfig config = (ProcessDefinitionConfig) xstream.fromXML(processToolConfigStream);

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


        }
        XStream xstream = new XStream();
        xstream.aliasPackage("config", ProcessDefinitionConfig.class.getPackage().getName());
        xstream.useAttributeFor(String.class);
        xstream.useAttributeFor(Boolean.class);
        xstream.useAttributeFor(Integer.class);

        ProcessDefinitionConfig config = (ProcessDefinitionConfig) xstream.fromXML(processToolConfigStream);

        if (logoStream != null) {
            byte[] logoBytes;
View Full Code Here

    if (input == null) {
      return null;
    }
    XStream xstream = new XStream();
    xstream.aliasPackage("config", ProcessRoleConfig.class.getPackage().getName());
    xstream.useAttributeFor(String.class);
    xstream.useAttributeFor(Boolean.class);
    xstream.useAttributeFor(Integer.class);
    return (Collection<ProcessRoleConfig>) xstream.fromXML(input);
  }
View Full Code Here

      return null;
    }
    XStream xstream = new XStream();
    xstream.aliasPackage("config", ProcessRoleConfig.class.getPackage().getName());
    xstream.useAttributeFor(String.class);
    xstream.useAttributeFor(Boolean.class);
    xstream.useAttributeFor(Integer.class);
    return (Collection<ProcessRoleConfig>) xstream.fromXML(input);
  }

  private void createRoles(Collection<ProcessRoleConfig> roles) {
View Full Code Here

    }
    XStream xstream = new XStream();
    xstream.aliasPackage("config", ProcessRoleConfig.class.getPackage().getName());
    xstream.useAttributeFor(String.class);
    xstream.useAttributeFor(Boolean.class);
    xstream.useAttributeFor(Integer.class);
    return (Collection<ProcessRoleConfig>) xstream.fromXML(input);
  }

  private void createRoles(Collection<ProcessRoleConfig> roles) {
    if (roles != null) {
View Full Code Here

    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) {
            InternalRules internalRules = (InternalRules) xstream.fromXML(getConfigLocation()
View Full Code Here

            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();
        if (CollectionUtils.isEmpty(rules)) {
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();
        r1.setNamespace("com.alibaba.cobar.client.entity.Follower");
View Full Code Here

      }

    };
    xstream.useAttributeFor(DefaultRelation.class, "rel");
    xstream.useAttributeFor(DefaultRelation.class, "href");
    xstream.useAttributeFor(DefaultRelation.class, "type");

    for (Class type : typesToEnhance) {
      realTypes.put(type, enhancer.enhanceResource(type));
      xstream.processAnnotations(type);
    }
View Full Code Here

      protected MapperWrapper wrapMapper(MapperWrapper next) {
        return new LinkSupportWrapper(next);
      }

    };
    xstream.useAttributeFor(DefaultRelation.class, "rel");
    xstream.useAttributeFor(DefaultRelation.class, "href");
    xstream.useAttributeFor(DefaultRelation.class, "type");

    for (Class type : typesToEnhance) {
      realTypes.put(type, enhancer.enhanceResource(type));
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.