Package org.apache.isis.core.metamodel.spec

Examples of org.apache.isis.core.metamodel.spec.ObjectSpecification.createObject()


public class PojoRecreatorDefault implements PojoRecreator {

    public Object recreatePojo(final TypedOid oid) {
        final ObjectSpecification spec = getSpecificationLoader().lookupBySpecId(oid.getObjectSpecId());
        final Object pojo = spec.createObject();
        if(oid.isViewModel()) {
            // initialize the view model pojo from the oid's identifier
           
            final ViewModelFacet facet = spec.getFacet(ViewModelFacet.class);
            if(facet == null) {
View Full Code Here


        ObjectAdapter adapter;
       
        final Oid oid = getOid();
    if (spec.isParentedOrFreeCollection()) {
         
          final Object recreatedPojo = spec.createObject();
          adapter = getPersistenceSession().mapRecreatedPojo(oid, recreatedPojo);
            populateCollection(adapter, (CollectionData) data);
           
        } else {
          Assert.assertTrue("oid must be a TypedOid representing an object because spec is not a collection and cannot be a value", oid instanceof TypedOid);
View Full Code Here

        ObjectAdapter adapter;
       
        final Oid oid = getOid();
    if (spec.isParentedOrFreeCollection()) {
         
          final Object recreatedPojo = spec.createObject();
          adapter = getPersistenceSession().mapRecreatedPojo(oid, recreatedPojo);
            populateCollection(adapter, (CollectionData) data);
           
        } else {
          Assert.assertTrue("oid must be a TypedOid representing an object because spec is not a collection and cannot be a value", oid instanceof TypedOid);
View Full Code Here

class PojoRecreatorDefault implements PojoRecreator {

    public Object recreatePojo(final TypedOid oid) {
        final ObjectSpecification spec = getSpecificationLoader().lookupBySpecId(oid.getObjectSpecId());
        final Object pojo = spec.createObject();
        if(oid.isViewModel()) {
            // initialize the view model pojo from the oid's identifier
           
            final ViewModelFacet facet = spec.getFacet(ViewModelFacet.class);
            if(facet == null) {
View Full Code Here

                mapping = requestTransients.get(id);
            }
            if (mapping == null) {
                final String[] split = id.split("@");
                final ObjectSpecification spec = IsisContext.getSpecificationLoader().loadSpecification(split[0].substring(1));
                final Object pojo = spec.createObject(CreationMode.NO_INITIALIZE);
                final String oidData = split[1];
                final SerialOid oid = SerialOid.createTransient(Long.valueOf(oidData, 16).longValue());
                return IsisContext.getPersistenceSession().recreateAdapter(oid, pojo);
            }
            final ObjectAdapter mappedTransientObject = mapping.getObject();
View Full Code Here

            }
            if (mapping == null) {
                final String[] split = id.split("@");
                final ObjectSpecification spec =
                    IsisContext.getSpecificationLoader().loadSpecification(split[0].substring(1));
                final Object pojo = spec.createObject(CreationMode.NO_INITIALIZE);
                final String oidData = split[1];
                final SerialOid oid = SerialOid.createTransient(Long.valueOf(oidData, 16).longValue());
                return IsisContext.getPersistenceSession().recreateAdapter(oid, pojo);
            }
            final ObjectAdapter mappedTransientObject = mapping.getObject();
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.