Package org.auraframework.throwable.quickfix

Examples of org.auraframework.throwable.quickfix.InvalidDefinitionException


    @Override
    public void validateDefinition() throws QuickFixException {
        super.validateDefinition();
       
        if (AuraTextUtil.isNullEmptyOrWhitespace(name)) {
            throw new InvalidDefinitionException("<aura:example> must have attribute 'name'.", getLocation());
        }
       
        if (AuraTextUtil.isNullEmptyOrWhitespace(label)) {
            throw new InvalidDefinitionException("<aura:example> must have attribute 'label'.", getLocation());
        }
       
        if (AuraTextUtil.isNullEmptyOrWhitespace(description)) {
            throw new InvalidDefinitionException("<aura:example> must contain a description.", getLocation());
        }
       
        if (!ref.exists()) {
            throw new InvalidDefinitionException(String.format("<aura:example> reference component %s does not exist.", ref.toString()), getLocation());
        }
    }
View Full Code Here


   
    @Override
    public void validateDefinition() throws QuickFixException {
        super.validateDefinition();
        if (AuraTextUtil.isNullEmptyOrWhitespace(description)) {
            throw new InvalidDefinitionException("<aura:description> must contain a description.", getLocation());
        }
    }
View Full Code Here

    @Override
    public void validateDefinition() throws QuickFixException {
        super.validateDefinition();
       
        if (descriptionDefs.isEmpty()) {
            throw new InvalidDefinitionException("<aura:documentation> must contain at least one <aura:description>", getLocation());
        }
    }
View Full Code Here

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

        if (includeRefs == null || includeRefs.isEmpty()) {
            throw new InvalidDefinitionException("aura:library must contain at least one aura:include attribute",
                    getLocation());
        }

        Set<String> names = Sets.newHashSet();
        for (IncludeDefRef include : includeRefs) {
            if (!names.add(include.getName())) {
                throw new InvalidDefinitionException(String.format("%s with duplicate name found in library: %s",
                        IncludeDefRefHandler.TAG, include.getName()), getLocation());
            }
            List<DefDescriptor<IncludeDef>> imports = include.getImports();
            if (imports != null) {
                for (DefDescriptor<IncludeDef> imported : imports) {
View Full Code Here

                }
            }
        }

        if (ordered.size() != unordered.size()) {
            throw new InvalidDefinitionException(
                    "aura:library: Unable to order include statements by dependency tree.", getLocation());
        }

        return ordered;
    }
View Full Code Here

            return getDefaultInvocation();
        } else if (object instanceof Map) {
            Map<?, ?> methodMap = (Map<?, ?>) object;
            String name = (String) methodMap.get("name");
            if (name == null) {
                throw new InvalidDefinitionException("A mock's stubbed method must specify 'name'", getLocation());
            }
            List<?> params = (List<?>) methodMap.get("params");
            String typeStr = (String) methodMap.get("type");
            Class<?> type = Object.class;
            if (typeStr != null) {
View Full Code Here

                if (error != null) {
                    return new ThrowsExceptionClass<>(error);
                }
            }
        }
        throw new InvalidDefinitionException("Mock answer must specify either 'value' or 'error'", null /* getLocation() */);
    }
View Full Code Here

            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

    @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

    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

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.