Package org.apache.isis.core.metamodel.exceptions

Examples of org.apache.isis.core.metamodel.exceptions.MetaModelException


            descriptions = (String[]) InvokeUtils.invokeStatic(descriptionMethod, new Object[0]);
        } catch (final ClassCastException ex) {
            // ignore
        }
        if (descriptions == null || descriptions.length != numElementsRequired) {
            throw new MetaModelException(descriptionMethod + " must return an String[] array of same size as number of parameters of action");
        }
        return descriptions;
    }
View Full Code Here


        if (!indicatesOptional(optionalMethod)) {
            return;
        }
        if (returnType.isPrimitive()) {
            throw new MetaModelException(cls.getName() + "#" + capitalizedName + " cannot be an optional property as it is of a primitive type");
        }
        final FacetHolder property = processMethodContext.getFacetHolder();
        FacetUtil.addFacet(new MandatoryFacetOptionalViaMethodForProperty(property));
    }
View Full Code Here

                optionalMethodReturnValue = (Boolean) InvokeUtils.invoke(method, new Object[0]);
            } catch (final ClassCastException ex) {
                // ignore
            }
            if (optionalMethodReturnValue == null) {
                throw new MetaModelException("method " + method + " should return a boolean");
            }
            return optionalMethodReturnValue.booleanValue();
        }
        return false;
    }
View Full Code Here

            description = (String) InvokeUtils.invokeStatic(descriptionMethod);
        } catch (final ClassCastException ex) {
            // ignore
        }
        if (description == null) {
            throw new MetaModelException("method " + descriptionMethod + "must return a string");
        }
        return description;
    }
View Full Code Here

            protectMethodReturnValue = (Boolean) InvokeUtils.invokeStatic(protectMethod);
        } catch (final ClassCastException ex) {
            // ignore
        }
        if (protectMethodReturnValue == null) {
            throw new MetaModelException("method " + protectMethod + "must return a boolean");
        }
        return protectMethodReturnValue;
    }
View Full Code Here

            alwaysHideMethodReturnValue = (Boolean) InvokeUtils.invokeStatic(alwaysHideMethod);
        } catch (final ClassCastException ex) {
            // ignore
        }
        if (alwaysHideMethodReturnValue == null) {
            throw new MetaModelException("method " + alwaysHideMethod + "must return a boolean");
        }
        return alwaysHideMethodReturnValue;
    }
View Full Code Here

    }

    private Class<?> inferTypeOfIfPossible(final Method getMethod, final Class<?> addType, final Class<?> removeType, final FacetHolder collection) {

        if (addType != null && removeType != null && addType != removeType) {
            throw new MetaModelException("The addTo/removeFrom methods for " + getMethod.getDeclaringClass() + " must " + "both deal with same type of object: " + addType + "; " + removeType);
        }

        final Class<?> type = addType != null ? addType : removeType;
        if (type != null) {
            FacetUtil.addFacet(new TypeOfFacetInferredFromSupportingMethods(type, collection, getSpecificationLookup()));
View Full Code Here

            throw e;
        } catch (final InvocationTargetException e) {
            invocationException("Exception executing " + method, e);
            return null;
        } catch (final IllegalAccessException e) {
            throw new MetaModelException("illegal access of " + method, e);
        }
    }
View Full Code Here

            throw new IsisApplicationException(targetException);
        }
        if (targetException instanceof RuntimeException) {
            throw (RuntimeException) targetException;
        } else {
            throw new MetaModelException(targetException);
        }
    }
View Full Code Here

            }
            processMethodContext.removeMethod(defaultMethod);

            final FacetedMethod facetedMethod = processMethodContext.getFacetHolder();
            if (facetedMethod.containsDoOpFacet(ActionDefaultsFacet.class)) {
                throw new MetaModelException(cls + " uses both old and new default syntax for " + actionMethod.getName() + "(...) - must use one or other");
            }

            // add facets directly to parameters, not to actions
            final FacetedMethodParameter paramAsHolder = parameters.get(i);
            FacetUtil.addFacet(new ActionParameterDefaultsFacetViaMethod(defaultMethod, paramAsHolder));
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.exceptions.MetaModelException

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.