Package org.apache.openjpa.lib.util.Localizer

Examples of org.apache.openjpa.lib.util.Localizer.Message


     */
    public void assertNoIndex(MetaDataContext context, boolean die) {
        if (_idx == null)
            return;

        Message msg = _loc.get("unexpected-index", context);
        if (die)
            throw new MetaDataException(msg);
        context.getRepository().getLog().warn(msg);
    }
View Full Code Here


     */
    public void assertNoUnique(MetaDataContext context, boolean die) {
        if (_unq == null)
            return;

        Message msg = _loc.get("unexpected-unique", context);
        if (die)
            throw new MetaDataException(msg);
        context.getRepository().getLog().warn(msg);
    }
View Full Code Here

     */
    public void assertNoForeignKey(MetaDataContext context, boolean die) {
        if (_fk == null)
            return;

        Message msg = _loc.get("unexpected-fk", context);
        if (die)
            throw new MetaDataException(msg);
        context.getRepository().getLog().warn(msg);
    }
View Full Code Here

            }
        }
        if (!join)
            return;

        Message msg = _loc.get("unexpected-join", context);
        if (die)
            throw new MetaDataException(msg);
        context.getRepository().getLog().warn(msg);
    }
View Full Code Here

            col.setType(type);
        } else if ((compat || !ttype) && !col.isCompatible(type, typeName,
            size, decimals)) {
            // if existing column isn't compatible with desired type, die if
            // can't adapt, else warn and change the existing column type
            Message msg = _loc.get(prefix + "-bad-col", context,
                Schemas.getJDBCName(type), col.getDescription());
            if (!adapt)
                throw new MetaDataException(msg);
            Log log = repos.getLog();
            if (log.isWarnEnabled())
View Full Code Here

        for (Iterator itr = _violations.iterator(); itr.hasNext();) {
            buf.append(itr.next());
            if (itr.hasNext())
                buf.append(sep);
        }
        Message msg = _loc.get("property-violations", buf);

        if (_fail)
            throw new UserException(msg);
        if (_log.isWarnEnabled())
            _log.warn(msg);
View Full Code Here

        if (args == null)
            argStr = getLocalizer().get(token).getMessage();
        else
            argStr = getLocalizer().get(token, args).getMessage();

        Message msg = _loc.get("parse-error", argStr, currentQuery());

        switch (e) {
            case EX_FATAL:
                throw new InternalException(msg, nest);
            case EX_UNSUPPORTED:
View Full Code Here

        if (vm.getEmbeddedMetaData() != null) {
            //throw parseException(EX_USER, "bad-predicate",
            //    new Object[]{ currentQuery() }, null);
            String argStr = _loc.get("bad-predicate",
                new Object[] {fmd.getName()}).getMessage();
            Message msg = _loc.get("parse-error", argStr, currentQuery);
            throw new UserException(msg, null);
        }
    }
View Full Code Here

        for (Iterator itr = _violations.iterator(); itr.hasNext();) {
            buf.append(itr.next());
            if (itr.hasNext())
                buf.append(sep);
        }
        Message msg = _loc.get("property-violations", buf);

        if (_fail)
            throw new UserException(msg);
        if (_log.isWarnEnabled())
            _log.warn(msg);
View Full Code Here

                Class<?> c = Class.forName(
                    "javax.validation.ValidationException");
            } catch (ClassNotFoundException e) {
                if (bValRequired) {
                    // fatal error - ValidationMode requires a validator
                    Message msg = _loc.get("vlem-creation-error");
                    log.error(msg, e);
                    // rethrow as a more descriptive/identifiable exception
                    throw new ValidationUnavailableException(
                        msg.getMessage(),
                        new RuntimeException(e), true);
                } else {
                    // no optional validation provider, so just trace output
                    if (log.isTraceEnabled()) {
                        log.trace(_loc.get("vlem-creation-warn",
                            "No available javax.validation APIs"));
                    }
                    return brc;
                }
            }
            // we have the javax.validation APIs
            try {
                // try loading a validation provider
                ValidatorImpl validator = new ValidatorImpl(conf);
                // set the Validator into the config
                conf.setValidatorInstance(validator);
                // update the LifecycleEventManager plugin to use it
                conf.setLifecycleEventManager("validating");
                // all done, so return good rc if anyone cares
                brc = true;
            } catch (RuntimeException e) {
                if (bValRequired) {
                    // fatal error - ValidationMode requires a validator
                    // rethrow as a WrappedException
                    Message msg = _loc.get("vlem-creation-error");
                    log.error(msg, e);
                    // rethrow as a more descriptive/identifiable exception
                    throw new ValidationUnavailableException(
                        msg.getMessage(),
                        e, true);

                } else {
                    // unexpected, but validation is optional,
                    // so just log it as a warning
View Full Code Here

TOP

Related Classes of org.apache.openjpa.lib.util.Localizer.Message

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.