Package org.auraframework.throwable.quickfix

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


        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

        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

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

    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

    @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

            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

            if (parentDef == null) {
                throw new DefinitionNotFoundException(extendsDescriptor, getLocation());
            }

            if (parentDef.getDescriptor().equals(descriptor)) {
                throw new InvalidDefinitionException(String.format(
                        "%s cannot extend itself", getDescriptor()), getLocation());
            }

            if (!parentDef.isExtensible()) {
                throw new InvalidDefinitionException(String.format(
                        "%s cannot extend non-extensible component %s", getDescriptor(), extendsDescriptor),
                        getLocation());
            }

            registry.assertAccess(descriptor, parentDef);

            SupportLevel support = getSupport();
            DefDescriptor<T> extDesc = extendsDescriptor;
            while (extDesc != null) {
                T extDef = extDesc.getDef();
                if (support.ordinal() > extDef.getSupport().ordinal()) {
                    throw new InvalidDefinitionException(
                            String.format("%s cannot widen the support level to %s from %s's level of %s",
                                    getDescriptor(),
                                    support, extDesc, extDef.getSupport()), getLocation());
                }
View Full Code Here

                if (e.getStem() != null) { // checks for private attributes used in expressions ..
                    String stem = e.getStem().toString();
                    AttributeDef attr = getAttributeDef(stem);
                    if ((attr != null) && (attr.getVisibility() == Visibility.PRIVATE)
                            && (!this.attributeDefs.values().contains(attr))) {
                        throw new InvalidDefinitionException(String.format(
                                "Expression %s refers to a private attribute '%s' ", e, attr), e.getLocation());
                    }
                }
            }
        }
View Full Code Here

        // MasterDefRegistry reg =
        // Aura.getContextService().getCurrentContext().getDefRegistry();
        EventDef locationChangeDef = getLocationChangeEventDescriptor().getDef();
        if (!locationChangeDef.isInstanceOf(Aura.getDefinitionService().getDefDescriptor("aura:locationChange",
                EventDef.class))) {
            throw new InvalidDefinitionException(String.format("%s must extend aura:locationChange",
                    locationChangeDef.getDescriptor()), getLocation());
        }

        for (DefDescriptor<ThemeDef> themeDescriptor : themeDescriptors) {
            // the theme must not be a component theme. otherwise, it would allow users to circumvent var
            // cross-reference validation (regular themes enforce that cross references are defined in the same file,
            // but cmp themes allow cross references to the namespace-default file.)
            if (themeDescriptor.getDef().isCmpTheme()) {
                throw new InvalidDefinitionException(
                        String.format(
                                "%s must not specify a component-specific or app-specific theme as the main app theme",
                                getName()), getLocation());
            }
        }
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.