Examples of InvalidDefinitionException


Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

                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

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

        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

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

        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

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

        // super.validateDefinition();
        if (this.error != null) {
            throw this.error;
        }
        if (this.parentDescriptor == null) {
            throw new InvalidDefinitionException("No parent in DependencyDef", getLocation());
        }
    }
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

        MasterDefRegistry mdf = Aura.getContextService().getCurrentContext().getDefRegistry();
        Set<DefDescriptor<?>> found = mdf.find(this.dependency);
        if (found.size() == 0) {
            // TODO: QuickFix for broken dependency.
            if (error == null) {
                error = new InvalidDefinitionException("Invalid dependency " + this.dependency, getLocation());
            }
        }
        dependencies.addAll(found);
    }
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

        if (providerClass == null) {
            return null;
        }

        if (!providerClass.isAnnotationPresent(Provider.class)) {
            throw new InvalidDefinitionException(String.format(
                    "@Provider annotation is required on all Providers.  Not found on %s", descriptor),
                    new Location(providerClass.getCanonicalName(), 0));
        }

        AbstractJavaProviderDef.Builder<D> builder = newBuilder();
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

    @Override
    public void validateDefinition() throws QuickFixException {
        super.validateDefinition();
        if (descriptor == null) {
            throw new InvalidDefinitionException("Event cannot be null", location);
        }
    }
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

    public void validateReferences() throws QuickFixException {
        super.validateReferences();
       
        EventDef event = getEventDescriptor().getDef();
        if (event == null) {
            throw new InvalidDefinitionException("Cannot register event of type " + getEventDescriptor(), getLocation());
        }
       
        if (!event.getEventType().canBeFired()) {
            throw new InvalidDefinitionException("Cannot fire event of type: " + getEventDescriptor(), getLocation());
        }
       
        AuraContext context = Aura.getContextService().getCurrentContext();
        DefDescriptor<?> referencingDesc = context.getCurrentCallingDescriptor();
      if (referencingDesc != null) {
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

    @Override
    public void run() {
        if (this.actionDef == null) {
            addException(
                    new InvalidDefinitionException("No action found", new Location(
                            this.controllerDescriptor.getQualifiedName(), 0)), State.ERROR, true, false);
            return;
        }
        this.state = State.RUNNING;
View Full Code Here

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException

            def.validateDefinition();
        }
        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());
            }
        }

        for (AttributeDefRef facet : this.facets) {
            facet.validateDefinition();
        }
        for (RegisterEventDef def : events.values()) {
            def.validateDefinition();
        }
        for (EventHandlerDef def : eventHandlers) {
            def.validateDefinition();
        }
        for (ImportDef def : imports) {
            def.validateDefinition();
        }

        // an abstract component that you can't extend is pretty useless
        if (this.isAbstract() && !this.isExtensible()) {
            throw new InvalidDefinitionException(String.format(
                    "Abstract component %s must be extensible.", getDescriptor()), getLocation());
        }

        if (this.interfaces.contains(ROOT_MARKER)) {
            // only aura has root access (this could be solved with namespace
            // only visiblity of the rootComponent interface someday)
            if (!"aura".equals(this.descriptor.getNamespace())) {
                throw new InvalidDefinitionException(
                        String.format(
                                "Component %s cannot implement the rootComponent interface because it is not in the aura namespace",
                                getDescriptor()), getLocation());
            }
            // cannot be a root and extend something
            if (this.extendsDescriptor != null) {
                throw new InvalidDefinitionException(
                        String.format(
                                "Component %s cannot be a rootComponent and extend %s", getDescriptor(),
                                this.extendsDescriptor),
                        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.