Package org.geoserver.ManifestLoader.AboutModel

Examples of org.geoserver.ManifestLoader.AboutModel.ManifestModel


         */
        public AboutModel filterNameByRange(String from, String to) throws IllegalArgumentException {
            if (from == null || to == null) {
                throw new IllegalArgumentException("Unable to parse from or to are null");
            }
            return new AboutModel(getManifests().subSet(new ManifestModel(from), true,
                    new ManifestModel(to), true));
        }
View Full Code Here


            }
            AboutModel am = new AboutModel(new TreeSet<ManifestModel>(
                    new ManifestModel.ManifestComparator()));
            Iterator<ManifestModel> it = manifests.iterator();
            while (it.hasNext()) {
                ManifestModel tModel = it.next();
                // filter over properties
                if (LOGGER.isLoggable(Level.FINE))
                    LOGGER.fine(tModel.getName());
                if (tModel.getName().matches(regex)) {
                    am.getManifests().add(tModel);
                }
            }
            return am;
        }
View Full Code Here

                throw new IllegalArgumentException("Unable to parse key is null");
            }
            AboutModel am = new AboutModel();
            Iterator<ManifestModel> it = manifests.iterator();
            while (it.hasNext()) {
                ManifestModel tModel = it.next();
                if (filterPropertyByKey(tModel, key)) {
                    am.getManifests().add(tModel);
                }
            }
            return am;
View Full Code Here

                throw new IllegalArgumentException("Unable to parse: value is null");
            }
            AboutModel am = new AboutModel();
            Iterator<ManifestModel> it = manifests.iterator();
            while (it.hasNext()) {
                ManifestModel tModel = it.next();
                if (filterByPropertyValue(tModel, value)) {
                    am.getManifests().add(tModel);
                }
            }
            return am;
View Full Code Here

                throw new IllegalArgumentException("Unable to parse: property or key are null");
            }
            AboutModel am = new AboutModel();
            Iterator<ManifestModel> it = manifests.iterator();
            while (it.hasNext()) {
                ManifestModel tModel = it.next();
                if (filterPropertyByKeyValue(tModel, key, value)) {
                    am.getManifests().add(tModel);
                }
            }
            return am;
View Full Code Here

         * @param name (if null false is returned)
         * @return true if this set contained the specified element
         */
        public boolean remove(final String name) {
            if (name != null) {
                return manifests.remove(new ManifestModel(name));
            }
            return false;
        }
View Full Code Here

             * @return the generated model
             */
            private static ManifestModel parseManifest(final String name, final Manifest manifest,
                    final AttributesFilter<Map<String, String>> filter) {

                final ManifestModel m = new ManifestModel(name);

                // Main attributes
                try {
                    m.putAllEntries(filter.filter(manifest.getMainAttributes()));
                } catch (Exception e1) {
                    LOGGER.log(Level.FINER, e1.getMessage(), e1);
                }

                //
                Map<String, Attributes> attrs = manifest.getEntries();
                for (java.util.Map.Entry<String, Attributes> entry : attrs.entrySet()) {
                    try {
                        m.putAllEntries(filter.filter(entry.getValue()));
                    } catch (Exception e) {
                        LOGGER.log(Level.FINER, e.getMessage(), e);
                    }
                }

View Full Code Here

            }

            @Override
            public void marshal(Object source, HierarchicalStreamWriter writer,
                    MarshallingContext context) {
                ManifestModel model = (ManifestModel) source;
                writer.addAttribute("name", model.getName());
                for (java.util.Map.Entry<String, String> entry : model.getEntries().entrySet())
                    context.convertAnother(entry, new Converter() {

                        @Override
                        public boolean canConvert(Class type) {
                            if (java.util.Map.Entry.class.isAssignableFrom(type))
View Full Code Here

                @Override
                protected void wrapInternal(Map properties, SimpleHash model, AboutModel object) {
                    final List<Map<String, Object>> manifests = new ArrayList<Map<String, Object>>();
                    final Iterator<ManifestModel> it = object.getManifests().iterator();
                    while (it.hasNext()) {
                        final ManifestModel manifest = it.next();

                        final Map<String, Object> map = new HashMap<String, Object>();
                        map.put("name", manifest.getName());

                        final List<String> props = new ArrayList<String>();
                        map.put("properties", props);

                        final List<String> values = new ArrayList<String>();
                        map.put("valuez", values);

                        final Iterator<String> innerIt = manifest.getEntries().keySet().iterator();
                        while (innerIt.hasNext()) {
                            String key = innerIt.next();
                            props.add(key);
                            values.add(manifest.getEntries().get(key));
                        }
                        manifests.add(map);
                    }

                    properties.put("manifests", manifests);
View Full Code Here

        AboutModel resources = ManifestLoader.getResources();
        AboutModel filtered = resources.filterNameByRegex(resourceName);

        // extract first resource
        ManifestModel mm = filtered.getManifests().first();
        if (mm != null) {
            Assert.isTrue(mm.getName().matches(resourceName));
        } else {
            LOGGER.log(Level.WARNING, "Unable to test with this resource name: " + resourceName
                    + "\nNo resource found.");
        }
View Full Code Here

TOP

Related Classes of org.geoserver.ManifestLoader.AboutModel.ManifestModel

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.