Package org.apache.isis.core.metamodel.facets.actcoll.typeof

Examples of org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacet


                throw new ScimpiException("Field " + objectField.getId() + " is not a collection");
            }
            isFieldEditable = objectField.isUsable(IsisContext.getAuthenticationSession(), object, where).isAllowed();
            getPersistenceSession().resolveField(object, objectField);
            collection = objectField.get(object);
            final TypeOfFacet facet = objectField.getFacet(TypeOfFacet.class);
            elementSpec = facet.valueSpec();
            parentObjectId = objectId == null ? context.mapObject(object, Scope.REQUEST) : objectId;
            tableId = request.getOptionalProperty(ID, field);
        } else {
            final String id = request.getOptionalProperty(COLLECTION);
            collection = context.getMappedObjectOrResult(id);
View Full Code Here


    }

    @Test
    @Override
    public void testTypeOfFacet() throws Exception {
        final TypeOfFacet facet = specification.getFacet(TypeOfFacet.class);
        Assert.assertNotNull(facet);
        Assert.assertEquals(ReflectorTestPojo.class, facet.value());
    }
View Full Code Here

        Assert.assertNull(facet);
    }

    @Test
    public void testNoTypeOfFacet() throws Exception {
        final TypeOfFacet facet = specification.getFacet(TypeOfFacet.class);
        Assert.assertNull(facet);
    }
View Full Code Here

            final FacetedMethod facetedMethod = FacetedMethod.createForCollection(introspectedClass, accessorMethod);
            getFacetProcessor().process(introspectedClass, accessorMethod, methodRemover, facetedMethod, FeatureType.COLLECTION, properties);

            // figure out what the type is
            Class<?> elementType = Object.class;
            final TypeOfFacet typeOfFacet = facetedMethod.getFacet(TypeOfFacet.class);
            if (typeOfFacet != null) {
                elementType = typeOfFacet.value();
            }
            facetedMethod.setType(elementType);

            // skip if class substitutor says so.
            if (classSubstitutor.getClass(elementType) == null) {
View Full Code Here

        final ObjectSpecification returnType = serviceAction.getReturnType();
        if (returnType == null) {
            return;
        }
        if (returnType.isParentedOrFreeCollection()) {
            final TypeOfFacet facet = serviceAction.getFacet(TypeOfFacet.class);
            if (facet != null) {
                final ObjectSpecification elementType = facet.valueSpec();
                addIfReturnsSubtype(serviceAction, elementType, matchingActionsToAppendTo);
            }
        } else {
            addIfReturnsSubtype(serviceAction, returnType, matchingActionsToAppendTo);
        }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacet

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.