Examples of InvalidDefinitionException


Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

            if (events.containsKey(attributeDefRef.getDescriptor().getName())) {
                EventHandlerImpl eh = new EventHandlerImpl(attributeDefRef.getDescriptor().getName());
                Object o = attributeDefRef.getValue();
                if (!(o instanceof PropertyReference)) {
                    // FIXME: where are we?
                    throw new InvalidDefinitionException(String.format("%s no can haz %s", eh.getName(), o),
                            SUPER_PASSTHROUGH);
                }
                eh.setActionExpression((PropertyReference) o);
                set(eh);
                return;
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

    @Override
    public Object getValue(String name) throws QuickFixException {
        PropertyReference expr = new PropertyReferenceImpl(name,
                AuraUtil.getExternalLocation("direct attributeset access"));
        if (expr.size() != 1) {
            throw new InvalidDefinitionException("No dots allowed", expr.getLocation());
        }
        return getValue(expr);
    }
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

    private void setExpression(DefDescriptor<AttributeDef> desc, Object value) throws QuickFixException {
        RootDefinition rd = rootDefDescriptor.getDef();
        AttributeDef ad = rd.getAttributeDefs().get(desc);
        if (ad == null) {
            // this location isn't even close to right...
            throw new InvalidDefinitionException(String.format("Attribute %s not defined on %s", desc.getName(),
                    rootDefDescriptor.getName()), rd.getLocation());
        }

        AttributeImpl att = new AttributeImpl(desc);
        if (value instanceof Expression) {
View Full Code Here

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

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

    @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

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

                    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

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

                    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

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

        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

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

                        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

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

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