Package org.auraframework.throwable.quickfix

Examples of org.auraframework.throwable.quickfix.InvalidReferenceException


    public void validateReferences() throws QuickFixException {
      EventDef event = null;
        if (name == null && descriptor != null) {
            event = descriptor.getDef();
            if (event == null) {
                throw new InvalidReferenceException(String.format("aura:handler has invalid event attribute value: %s",
                        descriptor), getLocation());
            }
           
            if (!event.getEventType().equals(EventType.APPLICATION)) {
                throw new InvalidReferenceException(
                        "A aura:handler that specifies an event=\"\" attribute must handle an application event. Either change the aura:event to have type=\"APPLICATION\" or alternately change the aura:handler to specify a name=\"\" attribute.",
                        getLocation());
            }
        } else if (name != null && descriptor == null && value == null) {
            RootDefinition parentDef = parentDescriptor.getDef();
            Map<String, RegisterEventDef> events = parentDef.getRegisterEventDefs();
            RegisterEventDef registerEvent = events.get(name);
            if (registerEvent == null) {
                throw new InvalidReferenceException(String.format("aura:handler has invalid name attribute value: %s",
                        name), getLocation());
            }
           
            event = registerEvent.getDescriptor().getDef();
            if (!event.getEventType().equals(EventType.COMPONENT)) {
                throw new InvalidReferenceException(
                        "A aura:handler that specifies a name=\"\" attribute must handle a component event. Either change the aura:event to have type=\"COMPONENT\" or alternately change the aura:handler to specify an event=\"\" attribute.",
                        getLocation());
            }
        }
       
View Full Code Here


                "attributes").getValue();

        for (DefDescriptor<AttributeDef> at : lazyAttributes.keySet()) {
            AttributeDef other = def.getAttributeDef(at.getName());
            if (other == null) {
                throw new InvalidReferenceException(String.format("Attribute %s does not exist", at.getName()),
                        getLocation());
            }
            DefDescriptor<TypeDef> otherType = other.getTypeDef().getDescriptor();
            if (!(otherType.getPrefix().equals("aura") && acceptableAttributeTypes.contains(otherType.getName()))) {
                throw new InvalidReferenceException(
                        String.format(
                                "Lazy Component References can only have attributes of simple types passed in (%s is not simple)",
                                at.getName()), getLocation());
            }
        }
View Full Code Here

TOP

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

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.