Package org.auraframework.throwable.quickfix

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException


        Class<?> c = getClazz(descriptor);
        if (c == null) {
            return null;
        }
        if (!c.isAnnotationPresent(Model.class)) {
            throw new InvalidDefinitionException(String.format(
                    "@Model annotation is required on all Models.  Not found on %s", descriptor), new Location(
                    descriptor.getName(), 0));
        }

        JavaModelDefImpl.Builder builder = new JavaModelDefImpl.Builder();
View Full Code Here


    @Override
    public void validateDefinition() throws QuickFixException {
        super.validateDefinition();

        if (this.typeDefDescriptor == null) {
            throw new InvalidDefinitionException("Invalid typeDefDescriptor: null", getLocation());
        }

        String name = this.descriptor.getName();
        // Calls the validateAttributeName method in AuraTextUtil.java to check if its a valid attribute name
        if ((AuraTextUtil.validateAttributeName(name)) != true) {
            throw new InvalidDefinitionException("Invalid attribute name: '" + name
                    + "', Refer to AuraDocs for valid attribute names", getLocation());
        }

        if (this.serializeTo == SerializeToType.INVALID) {
            throw new InvalidDefinitionException("Invalid serializeTo value", getLocation());
        }

        if (this.visibility == Visibility.PRIVATE && this.required == true) {
            throw new InvalidDefinitionException("Cannot set an attribute as required and private", getLocation());
        }
    }
View Full Code Here

                    providerDef = root.getProviderDef();
                    if (providerDef != null) {
                        // In this case, we have a 'remote' provider (i.e. client side) and we simply
                        // continue on as if nothing happened.
                    } else {
                      throw new InvalidDefinitionException(String.format("%s cannot be instantiated directly.",
                            descriptor), root.getLocation());
                    }
                }

                if (providerDef.isLocal()) {
View Full Code Here

                    if (StaticComponentConfigProvider.class.isAssignableFrom(theIfc)) {
                        staticConfigProv = (StaticComponentConfigProvider) builder.getProviderClass().newInstance();
                    }
                }
            } catch (InstantiationException ie) {
                throw new InvalidDefinitionException("Cannot instantiate " + builder.getProviderClass().getName(), location);
            } catch (IllegalAccessException iae) {
                throw new InvalidDefinitionException("Constructor is inaccessible for "
                        + builder.getProviderClass().getName(), location);
            } catch (RuntimeException e) {
                throw new InvalidDefinitionException("Failed to instantiate " + builder.getProviderClass().getName(),
                        location, e);
            }
        }
        this.configProvider = configProv;
        this.descriptorProvider = descriptorProv;
        this.staticConfigProvider = staticConfigProv;

        // FIXME!!! W-1191791
        if (configProvider == null && descriptorProvider == null) {
            throw new InvalidDefinitionException("@Provider must have a provider interface.", location);
        }
    }
View Full Code Here

        builder.setControllerClass(c);
        // FIXME = "we need an md5";
        builder.setLocation(c.getCanonicalName(), -1);
        Controller ann = c.getAnnotation(Controller.class);
        if (ann == null) {
            throw new InvalidDefinitionException(String.format(
                    "@Controller annotation is required on all Controllers.  Not found on %s", descriptor),
                    builder.getLocation());
        }
        builder.setBean(ann.bean());
        try {
View Full Code Here

                        loggableParams.add(paramName);
                    }
                }
            }
            if (!found) {
                throw new InvalidDefinitionException("@Key annotation is required on all action parameters",
                        new Location(controllerClass.getName() + "." + name, 0));
            }
        }
        actionBuilder.setParams(params);
        actionBuilder.setLoggableParams(loggableParams);
View Full Code Here

       
        return actionBuilder.build();
    }

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

                JavaActionDef action = makeActionDef(method, controllerClass, controllerDesc);

                if (action != null) {
                    // this line disallows action overloading. dunno if we care.
                    if (actions.containsKey(action.getName())) {
                        throw new InvalidDefinitionException("Duplicate action " + action.getName(), new Location(
                                controllerClass.getName(), 0));
                    }
                    actions.put(action.getName(), action);
                }
            }
View Full Code Here

        Class<?> klass = builder.getProviderClass();
        if (providerType.isAssignableFrom(klass)) {
            try {
                provider = providerType.cast(klass.newInstance());
            } catch (InstantiationException ie) {
                throw new InvalidDefinitionException("Cannot instantiate " + klass.getName(), location);
            } catch (IllegalAccessException iae) {
                throw new InvalidDefinitionException("Constructor is inaccessible for " + klass.getName(), location);
            } catch (RuntimeException e) {
                throw new InvalidDefinitionException("Failed to instantiate " + klass.getName(), location, e);
            }
        } else {
            throw new InvalidDefinitionException("Provider must implement " + providerType, location);
        }
    }
View Full Code Here

        this.parentDescriptor = builder.parentDescriptor;
        if (builder.resource != null) {
            try {
                tmp = new DescriptorFilter(builder.resource, builder.type);
            } catch (IllegalArgumentException iae) {
                caught = new InvalidDefinitionException(iae.getMessage(), getLocation());
            }
        } else {
            caught = new InvalidDefinitionException("Missing required resource", getLocation());
        }
        this.dependency = tmp;
        this.error = caught;
    }
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.