Examples of parseTextEntry()


Examples of org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet.parseTextEntry()

                if (parameters[i] == null) {
                    objectParameters[i] = null;
                } else if (type.getFacet(ParseableFacet.class) != null) {
                    final ParseableFacet facet = type.getFacet(ParseableFacet.class);
                    Localization localization = IsisContext.getLocalization();
                    objectParameters[i] = facet.parseTextEntry(null, parameters[i], localization);
                } else {
                    objectParameters[i] = MethodsUtils.findObject(request.getContext(), parameters[i]);
                }
                i++;
            }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet.parseTextEntry()

                    throw new ScimpiException("Expected two parameters for the log-on method: " + loginMethodName);
                }

                Localization localization = IsisContext.getLocalization();
                ParseableFacet facet = parameters2.get(0).getSpecification().getFacet(ParseableFacet.class);
                parameters[0] = facet.parseTextEntry(null, username, localization);
                facet = parameters2.get(1).getSpecification().getFacet(ParseableFacet.class);
                parameters[1] = facet.parseTextEntry(null, password, localization);
                final ObjectAdapter result = loginAction.execute(object, parameters);
                isValid = result != null;
                if (isValid) {
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet.parseTextEntry()

                Localization localization = IsisContext.getLocalization();
                ParseableFacet facet = parameters2.get(0).getSpecification().getFacet(ParseableFacet.class);
                parameters[0] = facet.parseTextEntry(null, username, localization);
                facet = parameters2.get(1).getSpecification().getFacet(ParseableFacet.class);
                parameters[1] = facet.parseTextEntry(null, password, localization);
                final ObjectAdapter result = loginAction.execute(object, parameters);
                isValid = result != null;
                if (isValid) {
                    ObjectSpecification specification = result.getSpecification();
                    ObjectAssociation association = specification.getAssociation(roleFieldName);
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet.parseTextEntry()

                    final String message = parameters2.get(i).isValid(object, newEntry, localization);
                    if (message != null) {
                        consent = new Veto(message);
                        formState.setError("Not all fields are valid");
                    }
                    final ObjectAdapter entry = facet.parseTextEntry(null, newEntry, localization);
                    fieldState.setValue(entry);
                } catch (final TextEntryParseException e) {
                    consent = new Veto(e.getMessage());
                    formState.setError("Not all fields are valid");
                }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet.parseTextEntry()

                if (parameters[i] == null) {
                    objectParameters[i] = null;
                } else if (type.getFacet(ParseableFacet.class) != null) {
                    final ParseableFacet facet = type.getFacet(ParseableFacet.class);
                    Localization localization = IsisContext.getLocalization();
                    objectParameters[i] = facet.parseTextEntry(null, parameters[i], localization);
                } else {
                    objectParameters[i] = MethodsUtils.findObject(request.getContext(), parameters[i]);
                }
                i++;
            }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet.parseTextEntry()

        for (int i = 0; i < parameters.length; i++) {
            final ObjectSpecification typ = pars.get(i).getSpecification();
            if (typ.getFacet(ParseableFacet.class) != null) {
                final ParseableFacet facet = typ.getFacet(ParseableFacet.class);
                Localization localization = IsisContext.getLocalization();
                params[i] = facet.parseTextEntry(null, parameters[i], localization);           
            } else {
                params[i] = request.getContext().getMappedObject(parameters[i]);
            }
        }
        return params;
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet.parseTextEntry()

            } else if (field.getSpecification().containsFacet(ParseableFacet.class)) {
                try {
                    final ParseableFacet facet = field.getSpecification().getFacet(ParseableFacet.class);
                    final ObjectAdapter originalValue = field.get(object);
                    Localization localization = IsisContext.getLocalization();
                    final ObjectAdapter newValue = facet.parseTextEntry(originalValue, newEntry, localization);
                    consent = ((OneToOneAssociation) field).isAssociationValid(object, newValue);
                    fieldState.setValue(newValue);
                } catch (final TextEntryParseException e) {
                    consent = new Veto(e.getMessage());
                    // formState.setError("Not all fields have been entered correctly");
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet.parseTextEntry()

            }

            if (fields.get(i).getSpecification().containsFacet(ParseableFacet.class)) {
                final ParseableFacet facet = fields.get(i).getSpecification().getFacet(ParseableFacet.class);
                Localization localization = IsisContext.getLocalization();
                final ObjectAdapter newValue = facet.parseTextEntry(originalValue, newEntry, localization);
                ((OneToOneAssociation) fields.get(i)).set(object, newValue);
            } else {
                ((OneToOneAssociation) fields.get(i)).set(object, field.getValue());
            }
        }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet.parseTextEntry()

        final ParseableFacet parseableFacet = getTypeOfSpecification().getFacet(ParseableFacet.class);
        if (parseableFacet == null) {
            throw new RuntimeException("unable to parse string for " + getTypeOfSpecification().getFullIdentifier());
        }
        Localization localization = IsisContext.getLocalization();
        final ObjectAdapter adapter = parseableFacet.parseTextEntry(getObject(), enteredText, localization);

        setObject(adapter);
    }

    public String disable(Where where) {
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet.parseTextEntry()

    private ObjectAdapter parse(final String entryText) {
        final ObjectSpecification fieldSpecification = field.getSpecification();
        final ParseableFacet p = fieldSpecification.getFacet(ParseableFacet.class);
        try {
            Localization localization = IsisContext.getLocalization();
            return p.parseTextEntry(object, entryText, localization);
        } catch (final IllegalArgumentException ex) {
            throw new InvalidEntryException(ex.getMessage(), ex);
        }
    }
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.