Example usage for com.google.gwt.core.ext.linker.impl SelectionInformation getPropMap

List of usage examples for com.google.gwt.core.ext.linker.impl SelectionInformation getPropMap

Introduction

In this page you can find the example usage for com.google.gwt.core.ext.linker.impl SelectionInformation getPropMap.

Prototype

public TreeMap<String, String> getPropMap() 

Source Link

Usage

From source file:com.data2semantics.yasgui.mgwtlinker.linker.PermutationMapLinker.java

License:Open Source License

protected Map<String, Set<BindingProperty>> buildPermutationMap(TreeLogger logger, LinkerContext context,
        ArtifactSet artifacts) throws UnableToCompleteException {

    HashMap<String, Set<BindingProperty>> map = new HashMap<String, Set<BindingProperty>>();

    for (SelectionInformation result : artifacts.find(SelectionInformation.class)) {
        Set<BindingProperty> list = new HashSet<BindingProperty>();
        map.put(result.getStrongName(), list);

        TreeMap<String, String> propMap = result.getPropMap();
        Set<Entry<String, String>> set = propMap.entrySet();

        for (Entry<String, String> entry : set) {
            BindingProperty bindingProperty = new BindingProperty(entry.getKey(), entry.getValue());
            list.add(bindingProperty);/*from  w  ww.j  av a 2s.  c o  m*/
        }

    }

    return map;

}

From source file:org.jboss.errai.offline.linker.DefaultCacheManifestLinker.java

License:Apache License

/**
 * Creates the cache manifest artifact specific to the current permutation.
 * //  w  ww  .ja va  2  s . com
 * @param context
 *          the linker environment
 * @param logger
 *          the tree logger to record to
 * @param artifacts
 *          {@code null} in case no permutation specific artifacts exist
 */
private Artifact<?> createPermutationCacheManifestArtifact(LinkerContext context, TreeLogger logger,
        ArtifactSet artifacts) {

    final SelectionInformation si = artifacts.find(SelectionInformation.class).first();
    final PermutationCacheManifestArtifact cacheArtifact = new PermutationCacheManifestArtifact(this.getClass(),
            si.getStrongName(), si.getPropMap());

    for (final Artifact<?> artifact : artifacts) {
        if (artifact instanceof EmittedArtifact) {
            final EmittedArtifact ea = (EmittedArtifact) artifact;
            final String pathName = ea.getPartialPath();
            if (shouldBeCached(pathName)) {
                cacheArtifact.addCachedFile(pathName);
            }
        }
    }
    return cacheArtifact;
}