Package org.apache.commons.collections

Examples of org.apache.commons.collections.BeanMap


            Class<?> objectClass =
                Class.forName(getClassName(), true, getClassLoader());
            Object object = objectClass.newInstance();

            // Set all configured bean properties
            BeanMap map = new BeanMap(object);
            for (Object key : map.keySet()) {
                String value = properties.getProperty(key.toString());
                if (value != null) {
                    map.put(key, value);
                }
            }

            if (validate) {
                // Check that no invalid property names were configured
                for (Object key : properties.keySet()) {
                    if (!map.containsKey(key)
                            && properties.getProperty(key.toString()) != null) {
                        String msg =
                            "Configured class " + object.getClass().getName()
                            + " does not contain the property " + key
                            + ". Please fix the repository configuration.";
View Full Code Here


     * @throws Exception if the test repository could not be retrieved
     */
    private static Repository getIntegratedInstance() throws Exception {
        Class test =
            Class.forName("org.apache.jackrabbit.test.AbstractJCRTest");
        Map helper = new BeanMap(test.getField("helper").get(null));
        final Repository repository =
            (Repository) helper.get("repository");
        final Credentials superuser =
            (Credentials) helper.get("superuserCredentials");
        return new ProxyRepository(new RepositoryFactory() {

            public Repository getRepository() throws RepositoryException {
                return repository;
            }
View Full Code Here

            Class objectClass =
                Class.forName(getClassName(), true, getClassLoader());
            Object object = objectClass.newInstance();

            // Set all configured bean properties
            BeanMap map = new BeanMap(object);
            Iterator iterator = map.keyIterator();
            while (iterator.hasNext()) {
                String name = (String) iterator.next();
                String value = properties.getProperty(name);
                if (value != null) {
                    map.put(name, properties.getProperty(name));
                }
            }

            if (validate) {
                // Check that no invalid property names were configured
                Iterator it = properties.keySet().iterator();
                while (it.hasNext()) {
                    String key = (String) it.next();
                    if (!map.containsKey(key) && properties.getProperty(key) != null) {
                        String msg =
                            "Configured class " + object.getClass().getName()
                            + " does not contain the property " + key
                            + ". Please fix the repository configuration.";
                        log.error(msg);
View Full Code Here

     * @throws ConfigurationException on bean configuration errors
     */
    public Object newInstance() throws ConfigurationException {
        try {
            Object object = Class.forName(getClassName()).newInstance();
            BeanMap map = new BeanMap(object);
            Iterator iterator = map.keyIterator();
            while (iterator.hasNext()) {
                String name = (String) iterator.next();
                String value = properties.getProperty(name);
                if (value != null) {
                    map.put(name, properties.getProperty(name));
                }
            }
            return object;
        } catch (ClassNotFoundException e) {
            throw new ConfigurationException(
View Full Code Here

     * @throws Exception if the test repository could not be retrieved
     */
    private static Repository getIntegratedInstance() throws Exception {
        Class test =
            Class.forName("org.apache.jackrabbit.test.AbstractJCRTest");
        Map helper = new BeanMap(test.getField("helper").get(null));
        final Repository repository =
            (Repository) helper.get("repository");
        final Credentials superuser =
            (Credentials) helper.get("superuserCredentials");
        return new ProxyRepository(new RepositoryFactory() {

            public Repository getRepository() throws RepositoryException {
                return repository;
            }
View Full Code Here

    public Object newInstance() throws ConfigurationException {
        try {
            Class objectClass =
                Class.forName(getClassName(), true, getClassLoader());
            Object object = objectClass.newInstance();
            BeanMap map = new BeanMap(object);
            Iterator iterator = map.keyIterator();
            while (iterator.hasNext()) {
                String name = (String) iterator.next();
                String value = properties.getProperty(name);
                if (value != null) {
                    map.put(name, properties.getProperty(name));
                }
            }
            return object;
        } catch (ClassNotFoundException e) {
            throw new ConfigurationException(
View Full Code Here

     * @throws Exception if the test repository could not be retrieved
     */
    private static Repository getIntegratedInstance() throws Exception {
        Class test =
            Class.forName("org.apache.jackrabbit.test.AbstractJCRTest");
        Map helper = new BeanMap(test.getField("helper").get(null));
        final Repository repository =
            (Repository) helper.get("repository");
        final Credentials superuser =
            (Credentials) helper.get("superuserCredentials");
        return new Repository() {

            public String[] getDescriptorKeys() {
                return repository.getDescriptorKeys();
            }
View Full Code Here

            Class<?> objectClass =
                Class.forName(getClassName(), true, getClassLoader());
            Object object = objectClass.newInstance();

            // Set all configured bean properties
            BeanMap map = new BeanMap(object);
            for (Object key : map.keySet()) {
                String value = properties.getProperty(key.toString());
                if (value != null) {
                    map.put(key, value);
                }
            }

            if (validate) {
                // Check that no invalid property names were configured
                for (Object key : properties.keySet()) {
                    if (!map.containsKey(key)
                            && properties.getProperty(key.toString()) != null) {
                        String msg =
                            "Configured class " + object.getClass().getName()
                            + " does not contain the property " + key
                            + ". Please fix the repository configuration.";
View Full Code Here

    public Object newInstance() throws ConfigurationException {
        try {
            Class objectClass =
                Class.forName(getClassName(), true, getClassLoader());
            Object object = objectClass.newInstance();
            BeanMap map = new BeanMap(object);
            Iterator iterator = map.keyIterator();
            while (iterator.hasNext()) {
                String name = (String) iterator.next();
                String value = properties.getProperty(name);
                if (value != null) {
                    map.put(name, properties.getProperty(name));
                }
            }
            Iterator it = properties.keySet().iterator();
            while (it.hasNext()) {
                String key = (String) it.next();
                if (!map.containsKey(key) && properties.getProperty(key) != null) {
                    String msg = object.getClass().getName() + " does not support '" + key;
                    log.error(msg);
                    throw new ConfigurationException(msg);
                }
            }
View Full Code Here

            Class objectClass =
                Class.forName(getClassName(), true, getClassLoader());
            Object object = objectClass.newInstance();

            // Set all configured bean properties
            BeanMap map = new BeanMap(object);
            Iterator iterator = map.keyIterator();
            while (iterator.hasNext()) {
                String name = (String) iterator.next();
                String value = properties.getProperty(name);
                if (value != null) {
                    map.put(name, properties.getProperty(name));
                }
            }

            if (validate) {
                // Check that no invalid property names were configured
                Iterator it = properties.keySet().iterator();
                while (it.hasNext()) {
                    String key = (String) it.next();
                    if (!map.containsKey(key) && properties.getProperty(key) != null) {
                        String msg =
                            "Configured class " + object.getClass().getName()
                            + " does not contain the property " + key
                            + ". Please fix the repository configuration.";
                        log.error(msg);
View Full Code Here

TOP

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

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.