brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Feature: transform state
Date Wed, 24 Sep 2014 09:59:58 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/177#discussion_r17963106
  
    --- Diff: core/src/main/java/brooklyn/entity/rebind/transformer/CompoundTransformerLoader.java
---
    @@ -0,0 +1,65 @@
    +package brooklyn.entity.rebind.transformer;
    +
    +import java.util.Map;
    +
    +import brooklyn.entity.rebind.transformer.CompoundTransformer.Builder;
    +import brooklyn.entity.rebind.transformer.impl.XsltTransformerTest;
    +import brooklyn.util.ResourceUtils;
    +import brooklyn.util.exceptions.Exceptions;
    +import brooklyn.util.text.TemplateProcessor;
    +import brooklyn.util.yaml.Yamls;
    +
    +import com.google.common.annotations.Beta;
    +import com.google.common.collect.ImmutableMap;
    +import com.google.common.collect.Iterables;
    +
    +@Beta
    +public class CompoundTransformerLoader {
    +
    +    // TODO Improve error handing so get nicer errors.
    +    // TODO Improve names (e.g. always camel case?)
    +    // TODO Pass in classloader for reflectively loading rawDataTransformer?
    +    
    +    public static CompoundTransformer load(String contents) {
    +        CompoundTransformer.Builder builder = CompoundTransformer.builder();
    +        Iterable<Object> toplevel = Yamls.parseAll(contents);
    +        Map<String, Map<?,?>> rules = (Map<String, Map<?,?>>)
((Map<?,?>)Iterables.getOnlyElement(toplevel));
    --- End diff --
    
    Warning:
    Type safety: Unchecked cast from Map<capture#1-of ?,capture#2-of ?> to Map<String,Map<?,?>>


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message