Package org.apache.commons.beanutils

Examples of org.apache.commons.beanutils.ConversionException


      {
        return (defaultValue);
      }
      else
      {
        throw new ConversionException("No value specified");
      }
    }
    if (value instanceof JoinType)
    {
      return (value);
View Full Code Here


      {
        return (defaultValue);
      }
      else
      {
        throw new ConversionException("No value specified");
      }
    }
    if (value instanceof SplitType)
    {
      return (value);
View Full Code Here

     *             successfully
     */
    public Object convert(Class type, Object value)
    {
        if (value == null) {
            throw new ConversionException("No value specified");
        }
        if (type.isInstance(value)) {
            return value;
        }
        String qnameString = value.toString();

        int i = qnameString.indexOf(":");
        String ns = "";
        String nsUri = null;
        String service = qnameString;
        if(i > -1) {
            ns = qnameString.substring(0, i);
            service = qnameString.substring(i+1);
        }
        nsUri = digester.findNamespaceURI(ns);
        if(nsUri != null) {
            return new QName(nsUri, service, ns);
        } else {
            throw new ConversionException("Failed to create QName.  Namespace not found for: '" + ns + "'");
        }
    }
View Full Code Here

        Pattern retVal = null;
        try {
            retVal = getPattern(aPattern);
        }
        catch (final PatternSyntaxException e) {
            throw new ConversionException(
                "Failed to initialise regexp expression " + aPattern, e);
        }
        return retVal;
    }
View Full Code Here

        // Deal with a null value
        if (aValue == null) {
            if (useDefault) {
                return (defaultValue);
            }
            throw new ConversionException("No value specified");
        }

        // Deal with the no-conversion-needed case
        if (MODEL.getClass() == aValue.getClass()) {
            return (aValue);
        }

        // Parse the input value as a String into elements
        // and convert to the appropriate type
        try {
            final List list = parseElements(aValue.toString());
            final String[] results = new String[list.size()];

            for (int i = 0; i < results.length; i++) {
                results[i] = (String) list.get(i);
            }
            return (results);
        }
        catch (final Exception e) {
            if (useDefault) {
                return (defaultValue);
            }
            throw new ConversionException(aValue.toString(), e);
        }
    }
View Full Code Here

    {
        try {
            mOption = Enum.valueOf(mOptionClass, aOption.trim().toUpperCase());
        }
        catch (IllegalArgumentException iae) {
            throw new ConversionException("unable to parse " + aOption, iae);
        }
    }
View Full Code Here

    {
        try {
            mIgnorePattern = Utils.getPattern(aFormat);
        }
        catch (final PatternSyntaxException e) {
            throw new ConversionException("unable to parse " + aFormat, e);
        }
    }
View Full Code Here

        try {
            mTag = aTag;
            mTagRE = Utils.getPattern(aTag + "\\s+(.*$)");
        }
        catch (final PatternSyntaxException e) {
            throw new ConversionException("unable to parse " + aTag, e);
        }
    }
View Full Code Here

        try {
            mTagFormat = aFormat;
            mTagFormatRE = Utils.getPattern(aFormat);
        }
        catch (final PatternSyntaxException e) {
            throw new ConversionException("unable to parse " + aFormat, e);
        }
    }
View Full Code Here

        try {
            mAuthorFormat = aFormat;
            mAuthorFormatPattern = Utils.getPattern(aFormat);
        }
        catch (final PatternSyntaxException e) {
            throw new ConversionException("unable to parse " + aFormat, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.beanutils.ConversionException

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.