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

Examples of org.apache.isis.core.metamodel.spec.ObjectSpecId


    public boolean hasServices() {
        return servicesInjector.getRegisteredServices().size() > 0;
    }

    private RootOid getOidForServiceFromPersistenceLayer(ObjectSpecification serviceSpecification) {
        final ObjectSpecId objectSpecId = serviceSpecification.getSpecId();
        RootOid oid = servicesByObjectType.get(objectSpecId);
        if (oid == null) {
            oid = objectStore.getOidForService(serviceSpecification);
            servicesByObjectType.put(objectSpecId, oid);
        }
View Full Code Here


        final RootOid persistedRootOid;
        if(hintRootOid != null) {
            if(hintRootOid.isTransient()) {
                throw new IsisAssertException("hintRootOid must be persistent");
            }
            final ObjectSpecId hintRootOidObjectSpecId = hintRootOid.getObjectSpecId();
            final ObjectSpecId adapterObjectSpecId = adapter.getSpecification().getSpecId();
            if(!hintRootOidObjectSpecId.equals(adapterObjectSpecId)) {
                throw new IsisAssertException("hintRootOid's objectType must be same as that of adapter " +
                    "(was: '" + hintRootOidObjectSpecId + "'; adapter's is " + adapterObjectSpecId + "'");
            }
            // ok
View Full Code Here

    }

  private void cacheBySpecId() {
    final Map<ObjectSpecId, ObjectSpecification> specById = Maps.newHashMap();
        for (final ObjectSpecification objSpec : allSpecifications()) {
            final ObjectSpecId objectSpecId = objSpec.getSpecId();
            if (objectSpecId == null) {
                continue;
            }
            specById.put(objectSpecId, objSpec);
        }
View Full Code Here

    @Override
    public void validateSpecifications(ValidationFailures validationFailures) {
        final Map<ObjectSpecId, ObjectSpecification> specById = Maps.newHashMap();
        for (final ObjectSpecification objSpec : allSpecifications()) {
            final ObjectSpecId objectSpecId = objSpec.getSpecId();
            if (objectSpecId == null) {
                continue;
            }
            final ObjectSpecification existingSpec = specById.put(objectSpecId, objSpec);
            if (existingSpec == null) {
View Full Code Here

    private void allowingObjectSpecToReturnSpecIdFor(final Class<?> cls) {
        context.checking(new Expectations() {
            {
                oneOf(mockObjectSpec).getSpecId();
                will(returnValue(new ObjectSpecId(cls.getName())));
            }
        });
    }
View Full Code Here

        if (encodableFacet == null) {
            String reason = "ObjectSpec expected to have an EncodableFacet";
            throw new IllegalArgumentException(reason);
        }

        final ObjectSpecId specId = objectSpec.getSpecId();
        final JsonValueConverter jvc = converterBySpec.get(specId);
        if(jvc == null) {
            // best effort
            if (argValueRepr.isString()) {
                final String argStr = argValueRepr.asString();
View Full Code Here

        }

        public List<ObjectSpecId> getSpecIds() {
            return Lists.newArrayList(Iterables.transform(Arrays.asList(classes), new Function<Class<?>, ObjectSpecId>() {
                public ObjectSpecId apply(Class<?> cls) {
                    return new ObjectSpecId(cls.getName());
                }
            }));
        }
View Full Code Here

        return getObjectAdapter(resourceContext, oidStrUnencoded);
    }

    private static ObjectAdapter getObjectAdapter(RendererContext resourceContext, String oidStrUnencoded) {
        RootOidDefault rootOid = RootOidDefault.deString(oidStrUnencoded, getOidMarshaller());
        final ObjectSpecId specId = rootOid.getObjectSpecId();

        final ObjectSpecification spec = IsisContext.getSpecificationLoader().lookupBySpecId(specId);
        if(spec == null) {
            // eg "NONEXISTENT:123"
            return null;
View Full Code Here

        final BookmarkPolicyFacet facet = getBookmarkPolicyFacetIfAny();
        return facet != null && facet.value() == policy;
    }
   
    private BookmarkPolicyFacet getBookmarkPolicyFacetIfAny() {
        final ObjectSpecId specId = getObjectAdapterMemento().getObjectSpecId();
        final ObjectSpecification objectSpec = getSpecificationLoader().lookupBySpecId(specId);
        return objectSpec.getFacet(BookmarkPolicyFacet.class);
    }
View Full Code Here

    }

    private String classNameOf(PageParameters pp) {
        String oidStr = PageParameterNames.OBJECT_OID.getStringFrom(pp);
        RootOid oid = getOidMarshaller().unmarshal(oidStr, RootOid.class);
        ObjectSpecId objectSpecId = oid.getObjectSpecId();
        final String className = getSpecificationLoader().lookupBySpecId(objectSpecId).getIdentifier().getClassName();
        return className;
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.spec.ObjectSpecId

Copyright © 2018 www.massapicom. 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.