Example usage for com.google.gwt.core.ext.linker CompilationResult getSoftPermutations

List of usage examples for com.google.gwt.core.ext.linker CompilationResult getSoftPermutations

Introduction

In this page you can find the example usage for com.google.gwt.core.ext.linker CompilationResult getSoftPermutations.

Prototype

public abstract SoftPermutation[] getSoftPermutations();

Source Link

Document

Returns the permutations of the collapsed deferred-binding property values that are compiled into the CompilationResult.

Usage

From source file:cc.alcina.framework.gwt.appcache.linker.PermutationInfoLinker.java

License:Apache License

private List<Artifact<?>> emitSelectionInformation(String strongName, CompilationResult result) {
    List<Artifact<?>> emitted = new ArrayList<Artifact<?>>();
    for (SortedMap<SelectionProperty, String> propertyMap : result.getPropertyMap()) {
        TreeMap<String, String> propMap = new TreeMap<String, String>();
        for (Map.Entry<SelectionProperty, String> entry : propertyMap.entrySet()) {
            propMap.put(entry.getKey().getName(), entry.getValue());
        }//from w w w .jav a2s  .  c o  m
        // The soft properties may not be a subset of the existing set
        for (SoftPermutation soft : result.getSoftPermutations()) {
            // Make a copy we can add add more properties to
            TreeMap<String, String> softMap = new TreeMap<String, String>(propMap);
            // Make sure this SelectionInformation contains the soft
            // properties
            for (Map.Entry<SelectionProperty, String> entry : soft.getPropertyMap().entrySet()) {
                softMap.put(entry.getKey().getName(), entry.getValue());
            }
            emitted.add(new SelectionInformation(strongName, soft.getId(), softMap));
        }
    }
    return emitted;
}