Examples of ParameterException


Examples of com.sk89q.worldedit.util.command.parametric.ParameterException

        if (input != null) {
            TreeType type = TreeGenerator.lookup(input);
            if (type != null) {
                return type;
            } else {
                throw new ParameterException(
                        String.format("Can't recognize tree type '%s' -- choose from: %s", input, Arrays.toString(TreeType.values())));
            }
        } else {
            return TreeType.TREE;
        }
View Full Code Here

Examples of com.sk89q.worldedit.util.command.parametric.ParameterException

            if (actor instanceof Entity) {
                Extent extent = ((Entity) actor).getExtent();
                if (extent instanceof World) {
                    world = (World) extent;
                } else {
                    throw new ParameterException("A world is required.");
                }
            } else {
                throw new ParameterException("An entity is required.");
            }

            BiomeRegistry biomeRegistry = world.getWorldData().getBiomeRegistry();
            List<BaseBiome> knownBiomes = biomeRegistry.getBiomes();
            BaseBiome biome = Biomes.findBiomeByName(knownBiomes, input, biomeRegistry);
            if (biome != null) {
                return biome;
            } else {
                throw new ParameterException(
                        String.format("Can't recognize biome type '%s' -- use /biomelist to list available types", input));
            }
        } else {
            throw new ParameterException(
                    "This command takes a 'default' biome if one is not set, except there is no particular " +
                            "biome that should be 'default', so the command should not be taking a default biome");
        }
    }
View Full Code Here

Examples of org.apache.avalon.framework.parameters.ParameterException

                } catch (IOException e) {
                    // Ignored
                }
            }
        } catch (IOException e) {
            throw new ParameterException("Unable to set directory", e);
        }

        String databaseName = params.getParameter("datafile", "cocoon.dat");
        String indexName = params.getParameter("m_indexFile", "cocoon.idx");
        m_Order = params.getParameterAsInteger("order", 301);
View Full Code Here

Examples of org.apache.avalon.framework.parameters.ParameterException

        {
            return Class.forName( className ).newInstance();
        }
        catch ( final Exception e )
        {
            throw new ParameterException(
                "Unable to instantiate: " + className, e
            );
        }
    }
View Full Code Here

Examples of org.apache.avalon.framework.parameters.ParameterException

                } catch (IOException e) {
                    // Ignored
                }
            }
        } catch (IOException e) {
            throw new ParameterException("Unable to set directory", e);
        }

        String databaseName = params.getParameter("datafile", "cocoon.dat");
        String indexName = params.getParameter("m_indexFile", "cocoon.idx");
        m_Order = params.getParameterAsInteger("order", 301);
View Full Code Here

Examples of org.apache.avalon.framework.parameters.ParameterException

     */
    public void parameterize(Parameters parameters) throws ParameterException {
        this.preemptiveLoaderURI = parameters.getParameter("preemptive-loader-url", null);
        if ( null != this.preemptiveLoaderURI
             && this.preemptiveLoaderURI.indexOf("://") == -1) {
            throw new ParameterException("The preemptive-loader-url must be absolute: " + this.preemptiveLoaderURI);
        }
    }
View Full Code Here

Examples of org.apache.avalon.framework.parameters.ParameterException

                "org.apache.cocoon.components.classloader.ClassLoaderManagerImpl");
        if (classLoaderClass != null) {
            try {
                this.classLoaderManager = (ClassLoaderManager) ClassUtils.newInstance(classLoaderClass);
            } catch (Exception e) {
                throw new ParameterException("Unable to load class loader: " + classLoaderClass, e);
            }
        }
    }
View Full Code Here

Examples of org.apache.avalon.framework.parameters.ParameterException

            // Will use specific class
            getLogger().debug("Using factory " + factoryName);
            try {
                this.tfactoryClass = ClassUtils.loadClass(factoryName);
            } catch(ClassNotFoundException cnfe) {
                throw new ParameterException("Cannot load TransformerFactory class", cnfe);
            }

            if (! TransformerFactory.class.isAssignableFrom(tfactoryClass)) {
                throw new ParameterException("Class " + factoryName + " isn't a TransformerFactory");
            }
        }
    }
View Full Code Here

Examples of org.apache.avalon.framework.parameters.ParameterException

        String compilerClass = params.getParameter("compiler");
        try {
            this.compilerClass = ClassUtils.loadClass(compilerClass);
        } catch (ClassNotFoundException e) {
            throw new ParameterException("Unable to load compiler: " + compilerClass, e);
        }
        this.deleteSources = params.getParameterAsBoolean("delete-sources", false);
    }
View Full Code Here

Examples of org.apache.avalon.framework.parameters.ParameterException

            if (className != null) {
                this.codeFormatter = ClassUtils.loadClass(className);
            }
        } catch (Exception e) {
            getLogger().error("Error with \"code-formatter\" parameter", e);
            throw new ParameterException("Unable to load code formatter: " + className, e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.