Examples of parseTextEntry()


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

    private ObjectAdapter parse(final String entryText) {
        final ObjectSpecification parameterSpecification = parameter.getSpecification();
        final ParseableFacet p = parameterSpecification.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

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()

                    final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
                    facet.init(collection, elements);
                } else if (association.getSpecification().isParseable()) {
                    data = data.replaceAll("\\n", "\n");
                    final ParseableFacet facet = association.getSpecification().getFacet(ParseableFacet.class);
                    final ObjectAdapter value = facet.parseTextEntry(null, data);
                    ((OneToOneAssociation) association).initAssociation(object, value);
                } else if (association.isOneToOneAssociation()) {
                    final ObjectAdapter value = loaded.get(data);
                    ((OneToOneAssociation) association).initAssociation(object, value);
                }
View Full Code Here

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

        }
        final ParseableEntryActionParameter parameter = (ParseableEntryActionParameter) objectActionParameter;

        final ObjectSpecification parameterSpecification = parameter.getSpecification();
        final ParseableFacet p = parameterSpecification.getFacet(ParseableFacet.class);
        final ObjectAdapter newValue = p.parseTextEntry(null, proposedString);

        final ValidityContext<?> ic = parameter.createProposedArgumentInteractionContext(getAuthenticationSession(), InteractionInvocationMethod.BY_USER, adapter, arguments(newValue), getNumber());

        final InteractionResultSet buf = new InteractionResultSet();
        InteractionUtils.isValidResultSet(parameter, ic, buf);
View Full Code Here

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

            }
            final ObjectSpecification fieldSpecification = fieldSpecifications[i];
            if (fieldSpecification.isParseable()) {
                final ParseableFacet parser = fieldSpecification.getFacet(ParseableFacet.class);
                try {
                    entries[i] = parser.parseTextEntry(initialState[i], entryText[i]);
                } catch (final InvalidEntryException e) {
                    errors[i] = e.getMessage();
                } catch (final TextEntryParseException e) {
                    errors[i] = e.getMessage();
                }
View Full Code Here

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

            // REVIEW this block uses the existing adapter as it contains the
            // regex needed. This needs to
            // be reviewed in line with Dan's proposed changes to the reflector.
            final ObjectAdapter valueAdapter = initialState[i];
            final ParseableFacet parser = spec.getFacet(ParseableFacet.class);
            parser.parseTextEntry(valueAdapter, textEntry);
            // REVIEW what do we do when an exception is thrown - a parse fails?
        }
    }

    public abstract void checkForValidity(Context context);
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);
                    if (message != null) {
                        consent = new Veto(message);
                        formState.setError("Not all fields are valid");
                    }
                    final ObjectAdapter entry = facet.parseTextEntry(null, newEntry);
                    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()

                formState.setError("Not all fields have been set");
            } else if (field.getSpecification().containsFacet(ParseableFacet.class)) {
                try {
                    final ParseableFacet facet = field.getSpecification().getFacet(ParseableFacet.class);
                    final ObjectAdapter originalValue = field.get(object);
                    final ObjectAdapter newValue = facet.parseTextEntry(originalValue, newEntry);
                    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()

                continue;
            }

            if (fields.get(i).getSpecification().containsFacet(ParseableFacet.class)) {
                final ParseableFacet facet = fields.get(i).getSpecification().getFacet(ParseableFacet.class);
                final ObjectAdapter newValue = facet.parseTextEntry(originalValue, newEntry);
                ((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()

        ObjectAdapter referencedAdapter = null;
        if (parseableFacet != null) {
            // handle as parseable value
            try {
                referencedAdapter = parseableFacet.parseTextEntry(adapter, cellText);
            } catch (final IllegalArgumentException ex) {
                return SetUpObjectResult.CANNOT_PARSE;
            }

        } else {
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.