Examples of parseTextEntry()


Examples of org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacet.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, null);
                    ((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.collections.modify.CollectionFacet.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.collections.modify.CollectionFacet.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 String proposedString = (String) proposedValue;

        final ObjectSpecification parameterSpecification = getSpecification();
        final ParseableFacet p = parameterSpecification.getFacet(ParseableFacet.class);
        try {
            final ObjectAdapter parsedAdapter = p.parseTextEntry(null, proposedString, localization);
            return parsedAdapter;
        } catch(Exception ex) {
            return null;
        }
    }
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, null);
                    ((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 String proposedString = (String) proposedValue;

        final ObjectSpecification parameterSpecification = getSpecification();
        final ParseableFacet p = parameterSpecification.getFacet(ParseableFacet.class);
        try {
            final ObjectAdapter parsedAdapter = p.parseTextEntry(null, proposedString, localization);
            return parsedAdapter;
        } catch(Exception ex) {
            return null;
        }
    }
View Full Code Here

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

            // 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);
            Localization localization = IsisContext.getLocalization();
            parser.parseTextEntry(valueAdapter, textEntry, localization);
            // 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()

        // see if can handle as parseable value
        final ParseableFacet parseableFacet = noSpec.getFacet(ParseableFacet.class);
        if (parseableFacet != null) {
            try {
                return parseableFacet.parseTextEntry(contextAdapter, cellText, null);
            } 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()

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

        } else {
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 {
                    Localization localization = IsisContext.getLocalization();
                    entries[i] = parser.parseTextEntry(initialState[i], entryText[i], localization);
                } 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.