Package org.auraframework.throwable.quickfix

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


    }

    @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

        // 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

    }

    @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

     */
    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

    @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

    @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

            if (def == null) {
                throw new DefinitionNotFoundException(extended, getLocation());
            }
           
            if (extended.equals(descriptor)) {
                throw new InvalidDefinitionException(String.format("%s cannot extend itself", getDescriptor()),
                        getLocation());
            }
           
            registry.assertAccess(descriptor, def);
        }
View Full Code Here

    public void validateDefinition() throws QuickFixException {
        if (parseError != null) {
            throw parseError;
        }
        if (descriptor == null) {
            throw new InvalidDefinitionException("No descriptor", location);
        }

        if (this.visibility == Visibility.INVALID) {
            throw new InvalidDefinitionException("Invalid visibility value", getLocation());
        }
    }
View Full Code Here

                if (cause instanceof AuraExceptionInfo) {
                    AuraExceptionInfo aei = (AuraExceptionInfo)cause;
                    location = aei.getLocation();
                }
                this.parseError = new InvalidDefinitionException(cause.getMessage(), location, cause);
            }
        }
View Full Code Here

TOP

Related Classes of org.auraframework.throwable.quickfix.InvalidDefinitionException

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.