Examples of TypeOfFacet


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

        Assert.assertNull(facet);
    }

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

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

                }

                final ObjectAdapter resultAdapter = getAdapterManager().adapterFor(result);

                // copy over TypeOfFacet if required
                final TypeOfFacet typeOfFacet = getFacetHolder().getFacet(TypeOfFacet.class);
                resultAdapter.setElementSpecificationProvider(ElementSpecificationProviderFromTypeOfFacet.createFrom(typeOfFacet));

                if(command != null) {
                    if(!resultAdapter.getSpecification().containsDoOpFacet(ViewModelFacet.class)) {
                        final Bookmark bookmark = CommandUtil.bookmarkFor(resultAdapter);
View Full Code Here

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

    private final FacetHolder facetHolder = new FacetHolderImpl();
   
    private final Identifier identifier;

    private static ObjectSpecification typeOfSpec(final ObjectActionImpl objectAction, ObjectMemberContext objectMemberContext) {
        final TypeOfFacet actionTypeOfFacet = objectAction.getFacet(TypeOfFacet.class);
        SpecificationLoader specificationLookup = objectMemberContext.getSpecificationLookup();
        // TODO: a bit of a hack; ought really to set up a fallback TypeOfFacetDefault which ensures that there is always
        // a TypeOfFacet for any contributee associations created from contributed actions.
        Class<? extends Object> cls = actionTypeOfFacet != null? actionTypeOfFacet.value(): Object.class;
        return specificationLookup.loadSpecification(cls);
    }
View Full Code Here

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

        // copy over facets from contributed to own.
        FacetUtil.copyFacets(serviceAction.getFacetedMethod(), facetHolder);
       
        final NotPersistedFacet notPersistedFacet = new NotPersistedFacetAbstract(this) {};
        final DisabledFacet disabledFacet = disabledFacet();
        final TypeOfFacet typeOfFacet = new TypeOfFacetAbstract(getSpecification().getCorrespondingClass(), this, objectMemberContext.getSpecificationLookup()) {};
       
        FacetUtil.addFacet(notPersistedFacet);
        FacetUtil.addFacet(disabledFacet);
        FacetUtil.addFacet(typeOfFacet);
       
View Full Code Here

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

            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 (getClassSubstitutor().getClass(elementType) == null) {
View Full Code Here

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

    }

    private void processCollectionType(final ProcessClassContext processClassContext) {
        final FacetHolder facetHolder = processClassContext.getFacetHolder();
        final TypeOfFacet typeOfFacet = facetHolder.getFacet(TypeOfFacet.class);
        if (typeOfFacet == null) {
            final Class<?> collectionElementType = collectionElementType(processClassContext.getCls());
            facetHolder.addFacet(collectionElementType != Object.class ? new TypeOfFacetInferredFromGenerics(collectionElementType, facetHolder, getSpecificationLoader()) : new TypeOfFacetDefaultToObject(facetHolder, getSpecificationLoader()));
        } else {
            // nothing
View Full Code Here

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

        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

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

                }

                final ObjectAdapter resultAdapter = getAdapterManager().adapterFor(result);

                // copy over TypeOfFacet if required
                final TypeOfFacet typeOfFacet = getFacetHolder().getFacet(TypeOfFacet.class);
                resultAdapter.setElementSpecificationProvider(ElementSpecificationProviderFromTypeOfFacet.createFrom(typeOfFacet));

                if(command != null) {
                    if(!resultAdapter.getSpecification().containsDoOpFacet(ViewModelFacet.class)) {
                        final Bookmark bookmark = CommandUtil.bookmarkFor(resultAdapter);
View Full Code Here

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

        // we copy over the type onto the adapter itself
        // [not sure why this is really needed, surely we have enough info in
        // the adapter
        // to look this up on the fly?]
        final TypeOfFacet facet = otma.getFacet(TypeOfFacet.class);
        collectionAdapter.setElementSpecificationProvider(ElementSpecificationProviderFromTypeOfFacet.createFrom(facet));

        return collectionAdapter;
    }
View Full Code Here

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

        this.id = id;
    }

    @Override
    public void write(final PrintWriter writer) {
        final TypeOfFacet facet = collection.getSpecification().getFacet(TypeOfFacet.class);
        final Class<?> elementType = facet.value();
        final ObjectSpecification elementSpecification = IsisContext.getSpecificationLoader().loadSpecification(elementType);

        writer.print("<div class=\"item\">");
        writer.print("<a href=\"");
        writer.print(pathTo(Request.COLLECTION_COMMAND) + "?id=");
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.