Package org.apache.isis.core.metamodel.facets.object.encodeable

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


        if (encodeableObjectData.getEncodedObjectData() == null) {
            return null;
        }
        final ObjectSpecification spec = getSpecificationLoader().loadSpecification(encodeableObjectData.getType());
        final EncodableFacet encoder = spec.getFacet(EncodableFacet.class);
        final ObjectAdapter adapter = encoder.fromEncodedString(encodeableObjectData.getEncodedObjectData());
        return adapter;
    }

    // ///////////////////////////////////////////////////////
    // Helpers: updateLoadedObject
View Full Code Here


        if (data instanceof NullData) {
            field.initAssociation(adapter, null);
        } else {
            value = ((EncodableObjectData) data).getEncodedObjectData();
            final EncodableFacet encoder = field.getSpecification().getFacet(EncodableFacet.class);
            final ObjectAdapter valueAdapter = encoder.fromEncodedString(value);
            if (LOG.isDebugEnabled()) {
                LOG.debug("setting value for field " + field.getId() + ": " + valueAdapter);
            }
            field.initAssociation(adapter, valueAdapter);
        }
View Full Code Here

    private ObjectAdapter restoreLeafObject(final String encodedObject, final ObjectSpecification specification) {
        final EncodableFacet encoder = specification.getFacet(EncodableFacet.class);
        if (encoder == null) {
            throw new IsisException("No encoder for " + specification.getFullIdentifier());
        }
        final ObjectAdapter object = encoder.fromEncodedString(encodedObject);
        return object;
    }

    private ObjectData[] getUpdates() {
        final List<ObjectData> list = new ArrayList<ObjectData>();
View Full Code Here

        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

    }

    @Override
    public void undo() {
        final EncodableFacet facet = value.getFacet(EncodableFacet.class);
        final Object obj = facet.fromEncodedString(oldValue);
        final ObjectAdapter adapter = getAdapterManager().adapterFor(obj);
        value.setAssociation(object, adapter);
        // have commented this out because it isn't needed; the transaction
        // manager will do this
        // for us on endTransaction. Still, if I'm wrong and it is needed,
View Full Code Here

        if (isBoolean(objectSpec)) {
            if (!representation.isBoolean()) {
                throwIncompatibleException(objectSpec, representation);
            }
            final String argStr = "" + representation.asBoolean();
            return encodableFacet.fromEncodedString(argStr);
        }

        if (isInteger(objectSpec)) {
            if (representation.isInt()) {
                final String argStr = "" + representation.asInt();
View Full Code Here

        }

        if (isInteger(objectSpec)) {
            if (representation.isInt()) {
                final String argStr = "" + representation.asInt();
                return encodableFacet.fromEncodedString(argStr);
            }
            // best effort
            if (representation.isString()) {
                final String argStr = representation.asString();
                return encodableFacet.fromEncodedString(argStr);
View Full Code Here

                return encodableFacet.fromEncodedString(argStr);
            }
            // best effort
            if (representation.isString()) {
                final String argStr = representation.asString();
                return encodableFacet.fromEncodedString(argStr);
            }
            // give up
            throwIncompatibleException(objectSpec, representation);
        }
View Full Code Here

        if (isLong(objectSpec)) {
            if (!representation.isLong()) {
                throwIncompatibleException(objectSpec, representation);
            }
            final String argStr = "" + representation.asLong();
            return encodableFacet.fromEncodedString(argStr);
        }

        if (isBigInteger(objectSpec)) {
            if (representation.isBigInteger()) {
                final String argStr = "" + representation.asBigInteger();
View Full Code Here

        }

        if (isBigInteger(objectSpec)) {
            if (representation.isBigInteger()) {
                final String argStr = "" + representation.asBigInteger();
                return encodableFacet.fromEncodedString(argStr);
            }
            // best effort
            if (representation.isLong()) {
                final String argStr = "" + representation.asLong();
                return encodableFacet.fromEncodedString(argStr);
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.