Examples of parseTextEntry()


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

        // see if can handle as parseable value
        final ParseableFacet parseableFacet = noSpec.getFacet(ParseableFacet.class);
        if (parseableFacet != null) {
            try {
                return parseableFacet.parseTextEntry(contextAdapter, cellText);
            } catch (final TextEntryParseException ex) {
                throw ScenarioBoundValueException.arg(contextBinding, paramCell, "(cannot parse '" + cellText + "')");
            } catch (final IllegalArgumentException ex) {
                // REVIEW: isn't what is thrown, but perhaps
                // TextEntryParseException should inherit from
View Full Code Here

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 {
            return p.parseTextEntry(object, entryText);
        } 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()

    private ObjectAdapter parse(final String entryText) {
        final ObjectSpecification fieldSpecification = field.getSpecification();
        final ParseableFacet p = fieldSpecification.getFacet(ParseableFacet.class);
        try {
            return p.parseTextEntry(object, entryText);
        } 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()

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

        setObject(adapter);
    }

    public String disable() {
View Full Code Here

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

        final List<ObjectActionParameter> pars = action.getParameters();
        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);
                params[i] = facet.parseTextEntry(null, parameters[i]);
            } 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()

            final ObjectSpecification typ = spec.getSpecification();
            if (parameters[i] == null) {
                objectParameters[i] = null;
            } else if (typ.getFacet(ParseableFacet.class) != null) {
                final ParseableFacet facet = typ.getFacet(ParseableFacet.class);
                objectParameters[i] = facet.parseTextEntry(null, parameters[i]);
            } 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()

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

        if (parseable == null) {
            parseable = nakedObjectFeature.getSpecification().getFacet(ParseableFacet.class);
        }

        if (parseable != null) {
            proposedValueNO = parseable.parseTextEntry(nakedObject, proposedValue);
        } else {
            final String proposedValueOidStr = proposedValue;
            proposedValueNO = getObjectAdapter(proposedValueOidStr);
        }
        return proposedValueNO;
View Full Code Here

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 {
            return p.parseTextEntry(object, entryText);
        } 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 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
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.