Package org.apache.commons.collections

Examples of org.apache.commons.collections.Transformer


        assertEquals("NULL", map.get("NotInMap"));
    }

    public void testMapGet4() {
        HashMap base = new HashMap();
        Map map = DefaultedMap.decorate(base, new Transformer() {
            public Object transform(Object input) {
                if (input instanceof String) {
                    return "NULL";
                }
                return "NULL_OBJECT";
View Full Code Here


    public String projectVersion() {
        return config.getProjectVersion();
    }

    public Iterator domainNames() {
        Transformer tr = new Transformer() {

            public Object transform(Object input) {
                return ((DataDomain) input).getName();
            }
        };
View Full Code Here

                String name2 = (o1 != null) ? ((DataMap) o2).getName() : null;
                return Util.nullSafeCompare(true, name1, name2);
            }
        });

        Transformer tr = new Transformer() {

            public Object transform(Object input) {
                return ((DataMap) input).getName();
            }
        };
View Full Code Here

    public String nodeFactoryName(String domainName, String nodeName) {
        return findNode(domainName, nodeName).getDataSourceFactory();
    }

    public Iterator nodeNames(String domainName) {
        Transformer tr = new Transformer() {

            public Object transform(Object input) {
                return ((DataNode) input).getName();
            }
        };
View Full Code Here

       
        return new TransformIterator(nodes.iterator(), tr);
    }

    public Iterator linkedMapNames(String domainName, String nodeName) {
        Transformer tr = new Transformer() {

            public Object transform(Object input) {
                return ((DataMap) input).getName();
            }
        };
View Full Code Here

        Map<String, Object> context = new HashMap<String, Object>();
        context.put("contextType", contextType);
        context.put("contextNode", contextNode);
        context.put("contextParent", contextParent);
        for (Map.Entry<String, List<GWTJahiaNodePropertyValue>> entry : dependentValues.entrySet()) {
            context.put(entry.getKey(), CollectionUtils.collect(entry.getValue(), new Transformer() {
                public Object transform(Object input) {
                    return input.toString();
                }
            }));           
        }
View Full Code Here

            String includedTypes = StringUtils.substringBefore(param, ";");

            Set<String> excludedTypes = new HashSet<String>();
            String exclusion = StringUtils.substringAfter(param, ";");
            if (StringUtils.isNotBlank(exclusion)) {
                excludedTypes.addAll(CollectionUtils.collect(Arrays.asList(StringUtils.substringAfter(param, ";").split(",")), new Transformer() {
                    public Object transform(Object input) {
                        return ((String) input).trim();
                    }
                }));
            }
View Full Code Here

    @SuppressWarnings("unchecked")
    public Map<String, JCRPropertyWrapper> getProperties() {

        if (propertiesFacade == null) {
            propertiesFacade = LazyMap.decorate(new HashMap<String, String>(), new Transformer() {

                private Map<Object, JCRPropertyWrapper> accessedProperties = new HashMap<Object, JCRPropertyWrapper>();

                public Object transform(Object input) {
                    JCRPropertyWrapper property = null;
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public Map<String, String> getLanguages() {
        if (languages == null) {
            languages = LazyMap.decorate(new HashMap<String, String>(), new Transformer() {
                public Object transform(Object lang) {
                    return getContext() + context.getServletPath() + "/" + resource.getWorkspace() + "/" + lang + resource.getNode().getPath() +
                            ("default".equals(resource.getTemplate()) ? "" : "." + resource.getTemplate())
                            + ".html";
                }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public Map<String, String> getTemplates() {
        if (templates == null) {
            templates = LazyMap.decorate(new HashMap<String, String>(), new Transformer() {
                public Object transform(Object template) {
                    return buildURL(resource.getNode(), (String) template, resource.getTemplateType());
                }
            });
        }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.Transformer

Copyright © 2018 www.massapicom. 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.