Package org.apache.openjpa.lib.util

Examples of org.apache.openjpa.lib.util.ParseException


        if (str.length() <= 0)
            return super.unalias(str);
       
        // snag this case early as it only causes problems
        if (str.equals(","))
            throw new ParseException(s_loc.get("invalid-list-config",
                getProperty(), str, getAliasList()));
       
        // unalias the list and concatenate the list of
        // canonical values.  Also, catch any bad aliases.
        boolean found;
        String iString;
        StringBuffer retv = new StringBuffer();
        String[] vals = str.split(",", 0);
       
        for (int i = 0; i < vals.length; i++) {
            iString = vals[i] = vals[i].trim();
           
            found = false;
            if (i > 0)
                retv.append(',');
           
            for (int x = 0; x < aliases.length; x += 2)
                if (StringUtils.equals(iString, aliases[x])
                    || StringUtils.equals(iString, aliases[x + 1])) {
                    retv.append(aliases[x + 1]);
                    found = true;
                    break;
                }
           
            // If the alias list is not comprehensive, add any unknown
            // values back onto the list
            if (!found) {
                if (isAliasListComprehensive())
                    throw new ParseException(s_loc.get("invalid-list-config",
                        getProperty(), str, getAliasList()));
                else
                    retv.append(iString);
            }
        }
View Full Code Here


                    failures = new ArrayList();
                failures.add(val.getProperty());
            }
        }
        if (failures != null)
            throw new ParseException(_loc.get("invalid-property-descriptors",
                failures));

        return _pds;
    }
View Full Code Here

            clone._globals = _globals;
            return clone;
        } catch (RuntimeException re) {
            throw re;
        } catch (Exception e) {
            throw new ParseException(e);
        }
    }
View Full Code Here

        try {
            setInternalString(str);
        } catch (ParseException pe) {
            throw pe;
        } catch (RuntimeException re) {
            throw new ParseException(prop + ": " + val, re);
        }
    }
View Full Code Here

            try {
                setInternalObject(obj);
            } catch (ParseException pe) {
                throw pe;
            } catch (RuntimeException re) {
                throw new ParseException(prop + ": " + obj, re);
            }
        }
    }
View Full Code Here

            msg = "invalid-plugin-aliases-hint";
            params = new Object[]{
                val.getProperty(), alias, e.toString(),
                new TreeSet(Arrays.asList(keys)), closest, };
        }
        return new ParseException(_loc.get(msg, params), e);
    }
View Full Code Here

                msg = _loc.get("invalid-config-params", new String[]{
                    configurationName, obj.getClass().getName(),
                    invalidEntries.keySet().toString(),
                    findOptionsFor(obj.getClass()).toString(), });
            }
            throw new ParseException(msg);
        }
        if (configurable != null)
            configurable.endConfiguration();
    }
View Full Code Here

                }
                opts.put(prop, val);
            }
            return opts;
        } catch (RuntimeException re) {
            throw new ParseException(_loc.get("prop-parse", properties), re);
        }
    }
View Full Code Here

                    || StringUtils.equals(str, aliases[i + 1])
                    || (empty && aliases[i] == null))
                    return aliases[i + 1];

        if (isAliasListComprehensive() && aliases != null)
            throw new ParseException(s_loc.get("invalid-enumerated-config",
                getProperty(), str, Arrays.asList(aliases)));

        return (nullNotFound) ? null : str;
    }
View Full Code Here

                    failures = new ArrayList<String>();
                failures.add(val.getProperty());
            }
        }
        if (failures != null)
            throw new ParseException(_loc.get("invalid-property-descriptors",
                failures));

        return _pds;
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.lib.util.ParseException

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.