Package org.apache.isis.core.metamodel.facets.object.parseable

Examples of org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException


    @Override
    protected Integer doParse(final Object context, final String entry) {
        try {
            return Integer.valueOf(format.parse(entry).intValue());
        } catch (final ParseException e) {
            throw new TextEntryParseException("Not an whole number " + entry, e);
        }
    }
View Full Code Here


        for (final T enumConstant : enumConstants) {
            if (enumConstant.toString().equals(entry)) {
                return enumConstant;
            }
        }
        throw new TextEntryParseException("Unknown enum constant '" + entry + "'");
    }
View Full Code Here

            return new Percentage(new Float(format.parse(text).floatValue()));
        } catch (final ParseException e) {
            try {
                return new Percentage(asFloat(text));
            } catch (final ParseException ee) {
                throw new TextEntryParseException("Not a number " + text, ee);
            }
        }
    }
View Full Code Here

    @Override
    protected Float doParse(final Object context, final String entry) {
        try {
            return new Float(format.parse(entry).floatValue());
        } catch (final ParseException e) {
            throw new TextEntryParseException("Not a floating point number " + entry, e);
        }
    }
View Full Code Here

            final ObjectValidityContext validateContext = specification.createValidityInteractionContext(getAuthenticationSessionProvider().getAuthenticationSession(), InteractionInvocationMethod.BY_USER, adapter);
            validate(validateContext);

            return adapter;
        } catch (final NumberFormatException e) {
            throw new TextEntryParseException(e.getMessage(), e);
        } catch (final IllegalFormatException e) {
            throw new TextEntryParseException(e.getMessage(), e);
        } catch (final ParsingException e) {
            throw new TextEntryParseException(e.getMessage(), e);
        }
    }
View Full Code Here

    @Override
    protected Short doParse(final Object context, final String entry) {
        try {
            return Short.valueOf(format.parse(entry).shortValue());
        } catch (final ParseException e) {
            throw new TextEntryParseException("Not a whole number " + entry, e);
        }
    }
View Full Code Here

        for (final T enumConstant : enumConstants) {
            if (enumConstant.toString().equals(entry)) {
                return enumConstant;
            }
        }
        throw new TextEntryParseException("Unknown enum constant '" + entry + "'");
    }
View Full Code Here

                    .getAuthenticationSession(), InteractionInvocationMethod.BY_USER, adapter);
            validate(validateContext);

            return adapter;
        } catch (final NumberFormatException e) {
            throw new TextEntryParseException(e.getMessage(), e);
        } catch (final IllegalFormatException e) {
            throw new TextEntryParseException(e.getMessage(), e);
        } catch (final ParsingException e) {
            throw new TextEntryParseException(e.getMessage(), e);
        }
    }
View Full Code Here

        if ("true".equals(compareTo)) {
            return Boolean.TRUE;
        } else if ("false".startsWith(compareTo)) {
            return Boolean.FALSE;
        } else {
            throw new TextEntryParseException("Not a logical value " + entry);
        }
    }
View Full Code Here

                return new Color(Integer.parseInt(text.substring(1), 16));
            } else {
                return new Color(Integer.parseInt(text));
            }
        } catch (final NumberFormatException e) {
            throw new TextEntryParseException("Not a number " + text, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException

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.