Examples of fromEncodedString()


Examples of org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet.fromEncodedString()

        final JsonValueConverter jvc = converterBySpec.get(objectSpec.getSpecId());
        if(jvc == null) {
            // best effort
            if (argValueRepr.isString()) {
                final String argStr = argValueRepr.asString();
                return encodableFacet.fromEncodedString(argStr);
            }

            final String reason = "Unable to parse value";
            argRepr.mapPut("invalidReason", reason);
            throw new IllegalArgumentException(reason);
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet.fromEncodedString()

        }
       
        // last attempt
        if (argValueRepr.isString()) {
            final String argStr = argValueRepr.asString();
            return encodableFacet.fromEncodedString(argStr);
        }

        final String reason = "Could not parse value '" + argValueRepr.asString() + "' as a " + objectSpec.getFullIdentifier();
        argRepr.mapPut("invalidReason", reason);
        throw new IllegalArgumentException(reason);
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet.fromEncodedString()

        if (objectAsSerializable != null) {
            return IsisContext.getPersistenceSession().getAdapterManager().adapterFor(objectAsSerializable);
        } else {
            final ObjectSpecification spec = IsisContext.getSpecificationLoader().loadSpecification(getClassName());
            final EncodableFacet encodeableFacet = spec.getFacet(EncodableFacet.class);
            return encodeableFacet.fromEncodedString(objectAsEncodedString);
        }
    }

}
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet.fromEncodedString()

        if (objectAssoc.isOneToManyAssociation()) {
            updateOneToManyAssociation(objectAdapter, (OneToManyAssociation) objectAssoc, (CollectionData) fieldData);

        } else if (objectAssoc.getSpecification().containsFacet(EncodableFacet.class)) {
            final EncodableFacet facet = objectAssoc.getSpecification().getFacet(EncodableFacet.class);
            final ObjectAdapter value = facet.fromEncodedString((String) fieldData);
            ((OneToOneAssociation) objectAssoc).initAssociation(objectAdapter, value);

        } else if (objectAssoc.isOneToOneAssociation()) {
            updateOneToOneAssociation(objectAdapter, (OneToOneAssociation) objectAssoc, (Data) fieldData);
        }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet.fromEncodedString()

        final JsonValueConverter jvc = converterBySpec.get(specId);
        if(jvc == null) {
            // best effort
            if (argValueRepr.isString()) {
                final String argStr = argValueRepr.asString();
                return encodableFacet.fromEncodedString(argStr);
            }

            throw new IllegalArgumentException("Unable to parse value");
        }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet.fromEncodedString()

       
        // last attempt
        if (argValueRepr.isString()) {
            final String argStr = argValueRepr.asString();
            try {
                return encodableFacet.fromEncodedString(argStr);
            } catch(TextEntryParseException ex) {
                throw new IllegalArgumentException(ex.getMessage());
            }
        }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet.fromEncodedString()

        final String encodedValue = results.getString(columnName);
        if (encodedValue == null) {
            return null;
        }
        final EncodableFacet facet = field.getSpecification().getFacet(EncodableFacet.class);
        return facet.fromEncodedString(simplePasswordEncoderDecoder.decodeEncodedValueIntoRawString(encodedValue));
    }

}
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet.fromEncodedString()

                    final String valueData = data.value(field.getId());
                    if (valueData != null) {
                        if (valueData.equals("NULL")) {
                            value = null;
                        } else {
                            value = encoder.fromEncodedString(valueData);
                        }
                        ((OneToOneAssociation) field).initAssociation(adapter, value);
                    }
                } else if (field.isOneToManyAssociation()) {
                    initObjectSetupCollection(adapter, data, field);
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet.fromEncodedString()

        final String encodedValue = results.getString(columnName);
        if (encodedValue == null) {
            return null;
        }
        final EncodableFacet facet = field.getSpecification().getFacet(EncodableFacet.class);
        return facet.fromEncodedString(encodedValue);
    }

    @Override
    public String columnType() {
        return type;
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet.fromEncodedString()

            return null;
        }
       
        if(objSpec.isEncodeable()) {
            EncodableFacet encodeable = objSpec.getFacet(EncodableFacet.class);
            return encodeable.fromEncodedString(encoded);
        }
       
        try {
            final RootOid oid = RootOidDefault.deStringEncoded(encoded, getOidMarshaller());
            return getAdapterManager().adapterFor(oid);
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.