Examples of InvalidDefinitionException


Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

        for (DefDescriptor<ControllerDef> desc : getTargetDescriptor().getDef().getControllerDefDescriptors()) {
            if ("java".equals(desc.getPrefix())) {
                return desc.getDef();
            }
        }
        throw new InvalidDefinitionException("Unable to locate the server controller", getLocation());
    }
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

        throw new InvalidDefinitionException("Unable to locate the server controller", getLocation());
    }

    @Override
    protected Invocation getDefaultInvocation() throws QuickFixException {
        throw new InvalidDefinitionException("A mock action must specify the name of the action", getLocation());
    }
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

    protected Invocation getInvocation(Object object) throws QuickFixException {
        if (object instanceof Map) {
            Map<?, ?> methodMap = (Map<?, ?>) object;
            String name = (String) methodMap.get("name");
            if (name == null) {
                throw new InvalidDefinitionException("A mock action must specify the name of the action", getLocation());
            }
            String typeStr = (String) methodMap.get("type");
            Class<?> type = Object.class;
            if (typeStr != null) {
                try {
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

                                null, null, ImmutableList.<Object> of(e)));
                    }
                }
            }
        }
        throw new InvalidDefinitionException("Mock answer must specify either 'value' or 'error'", getLocation());
    }
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

    }

    @Override
    public void validateDefinition() throws QuickFixException {
        if (AuraTextUtil.isNullEmptyOrWhitespace(property)) {
            throw new InvalidDefinitionException(String.format("%s missing property attribute", ImportDefHandler.TAG),
                    getLocation());
        }
        if(!AuraTextUtil.isValidJsIdentifier(property)){
            throw new InvalidDefinitionException(String.format(
                    "%s 'property' attribute must be valid javascript identifier", ImportDefHandler.TAG), getLocation());
        }
    }
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

        // FIXME: need to store on context.
        return buildValidatedClass(def.getJavaType());
    }

    private static void throwConstructorError(String message, Class<?> clazz) throws QuickFixException {
        throw new InvalidDefinitionException(message,
                new Location("java://" + clazz.getCanonicalName(), 0));
    }
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

    }

    @Override
    public void validateDefinition() throws QuickFixException {
        if (getName() == null) {
            throw new InvalidDefinitionException(String.format("%s must specify a name", IncludeDefRefHandler.TAG),
                    getLocation());
        }
        if (export != null && !AuraTextUtil.isValidJsIdentifier(export)) {
            throw new InvalidDefinitionException(String.format(
                    "%s 'export' attribute must be valid javascript identifier", IncludeDefRefHandler.TAG),
                    getLocation());
        }
    }
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

     */
    private static DefDescriptor<TypeDef> getReturnTypeDescriptor(Method method) throws QuickFixException {
        int modifiers = method.getModifiers();

        if (!Modifier.isPublic(modifiers) || Modifier.isStatic(modifiers) || method.getParameterTypes().length > 0) {
            throw new InvalidDefinitionException(String.format("@AuraEnabled annotation found on invalid method %s",
                    method.getName()), new Location("java://" + method.getDeclaringClass().getCanonicalName(), 0));
        }
        Type type = method.getAnnotation(Type.class);
        if (type == null) {
            //
            // FIXME: need better checks here, including doing things like
            // List<Type>, arrays also need to be handled here.
            //
            if (Void.TYPE.equals(method.getGenericReturnType())) {
                throw new InvalidDefinitionException(String.format("@AuraEnabled annotation found on void method %s",
                        method.getName()), new Location("java://" + method.getDeclaringClass().getCanonicalName(), 0));
            }
            return DefDescriptorImpl.getInstance("java://" + method.getReturnType().getName(), TypeDef.class);
        } else {
            return DefDescriptorImpl.getInstance(type.value(), TypeDef.class);
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

    @Override
    public void validateDefinition() throws QuickFixException {
        super.validateDefinition();
        if (getDescriptor() == null) {
            throw new InvalidDefinitionException("Descriptor cannot be null for InterfaceDef", getLocation());
        }

        for (AttributeDef att : this.attributeDefs.values()) {
            att.validateDefinition();
            if (events.containsKey(att.getName())) {
                throw new InvalidDefinitionException(String.format(
                        "Cannot define an attribute and register an event with the same name: %s", att.getName()),
                        getLocation());
            }
            if(att.getVisibility() == Visibility.PRIVATE){
                throw new InvalidDefinitionException("Cannot declare an Interface attribute as private",getLocation());
            }
        }

        for (RegisterEventDef reg : this.events.values()) {
            reg.validateDefinition();
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

    @Override
    public void validateDefinition() throws QuickFixException {
        super.validateDefinition();
        for (String key : styleTokens.keySet()) {
            if (!key.equals(key.toUpperCase())) {
                throw new InvalidDefinitionException(String.format(
                        "All keys in style tokens must be all caps.  %s is not.", key), getLocation());
            }
        }
    }
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.