Package org.auraframework.throwable

Examples of org.auraframework.throwable.AuraRuntimeException


        }
        switch (ei.nameFormat) {
        case BUNDLED_EXTRA:
            if (bundle == null) {
                // whoops.
                throw new AuraRuntimeException("Invalid "+descriptor+"@"+descriptor.getDefType()+" with ei="+ei);
            }
            return String.format("%s%s%s%s%s%s", namespace, FILE_SEPARATOR, bundle.getName(), FILE_SEPARATOR, name, ei.extension);
        case BUNDLE:
            if (bundle != null) {
                // whoops.
                throw new AuraRuntimeException("Invalid "+descriptor+"@"+descriptor.getDefType()+" with ei="+ei);
            }
            // Alongside knowing the extension, we also know that namespace+name is a directory,
            // and name+ext is the file inside that directory:
            return String.format("%s%s%s%s%s%s", namespace, FILE_SEPARATOR, name, FILE_SEPARATOR, name, ei.extension);
        case NAMESPACE:
            return String.format("%s%s%s%s", namespace, FILE_SEPARATOR, namespace, ei.extension);
        }
        throw new AuraRuntimeException("Could not get path for "+descriptor+"@"+descriptor.getDefType()+" with ei="+ei);
    }
View Full Code Here


        LoggingService loggingService = Aura.getLoggingService();
        loggingService.startTimer(LoggingService.TIMER_DEF_DESCRIPTOR_CREATION);
        try {
            this.defType = DefType.getDefType(defClass);
            if (AuraTextUtil.isNullEmptyOrWhitespace(qualifiedName)) {
                throw new AuraRuntimeException("QualifiedName is required for descriptors");
            }

            String prefix = null;
            String namespace = null;
            String name = null;
            String nameParameters = null;

            switch (defType) {
            case CONTROLLER:
            case TESTSUITE:
            case MODEL:
            case RENDERER:
            case HELPER:
            case STYLE:
            case RESOURCE:
            case TYPE:
            case PROVIDER:
            case THEME_PROVIDER:
            case THEME_MAP_PROVIDER:
            case INCLUDE:
                Matcher matcher = CLASS_PATTERN.matcher(qualifiedName);
                if (matcher.matches()) {
                    prefix = matcher.group(1);
                    namespace = matcher.group(2);
                    if (namespace.isEmpty()) {
                        namespace = null;
                    }
                    name = matcher.group(3);
                    if (matcher.group(4) != null) {
                        // combine name with <generic params> if available
                        name += matcher.group(4);
                        if (defType == org.auraframework.def.DefDescriptor.DefType.TYPE) {
                            nameParameters = matcher.group(4);
                        }
                    }
                } else {
                    throw new AuraRuntimeException(String.format("Invalid Descriptor Format: %s[%s]", qualifiedName, defType.toString()));
                }

                break;
            // subtypes
            case ACTION:
            case DESCRIPTION:
                throw new AuraRuntimeException(
                        String.format("%s descriptor must be a subdef: %s", defType.name(), qualifiedName));
            case ATTRIBUTE:
            case LAYOUT:
            case LAYOUT_ITEM:
            case TESTCASE:
            case VAR:
            case THEME_DEF_REF:
            case ATTRIBUTE_DESIGN:
            case DESIGN_TEMPLATE:
            case DESIGN_TEMPLATE_REGION:
            case INCLUDE_REF:
                name = qualifiedName;
                break;
            case APPLICATION:
            case COMPONENT:
            case INTERFACE:
            case EVENT:
            case LIBRARY:
            case DOCUMENTATION:
            case EXAMPLE:
            case LAYOUTS:
            case NAMESPACE:
            case THEME:
            case DESIGN:
                Matcher tagMatcher = TAG_PATTERN.matcher(qualifiedName);
                if (tagMatcher.matches()) {
                    prefix = tagMatcher.group(1);
                    if (prefix == null) {
                        prefix = MARKUP_PREFIX;
                    }
                    namespace = tagMatcher.group(2);
                    name = tagMatcher.group(3);
                    if (AuraTextUtil.isNullEmptyOrWhitespace(name)) {
                        name = namespace;
                        namespace = null;
                    }
                    qualifiedName = buildQualifiedName(prefix, namespace, name);
                } else {
                    throw new AuraRuntimeException(String.format("Invalid Descriptor Format: %s[%s]", qualifiedName, defType.toString()));
                }

                break;
            }
View Full Code Here

     * @return An instance of a AuraDescriptor for the provided tag
     */
    public static <E extends Definition> DefDescriptor<E> getInstance(String name, Class<E> defClass,
            DefDescriptor<?> bundle) {
        if (name == null || defClass == null) {
            throw new AuraRuntimeException("descriptor is null");
        }

        DescriptorKey dk = new DescriptorKey(name, defClass, bundle);

        Cache<DescriptorKey, DefDescriptor<? extends Definition>> cache =
View Full Code Here

    }

    public static <E extends Definition> DefDescriptor<E> getAssociateDescriptor(DefDescriptor<?> desc,
            Class<E> defClass, String newPrefix) {
        if (desc == null) {
            throw new AuraRuntimeException("descriptor is null");
        }
        return new DefDescriptorImpl<>(desc, defClass, newPrefix);
    }
View Full Code Here

        // check for wrapped QFEs. However if it's a DefinitionNotFound... currently throwing one of those will
        // get confused with the StyleDef itself so we have to wrap it in a runtime exception (and kill the quickfix).
        if (!wrappedExceptions.isEmpty()) {
            QuickFixException e = wrappedExceptions.get(0);
            if (e instanceof DefinitionNotFoundException) {
                throw new AuraRuntimeException(e);
            }
            throw e;
        }

        if (hasMessages()) {
View Full Code Here

                }

                for (String prefix : loader.getPrefixes()) {
                    LoaderKey key = new LoaderKey(namespace, prefix);
                    if (mutableLoaderMap.containsKey(key)) {
                        throw new AuraRuntimeException(String.format(
                                "Namespace/Prefix combination %s claimed by 2 SourceLoaders : %s and %s", key
                                        .toString(), mutableLoaderMap.get(key).getClass().getName(), loader.getClass()
                                        .getName()));
                    }
View Full Code Here

    private <T extends Definition> Set<DefDescriptor<T>> find(Class<T> primaryInterface, String prefix, String namespace) {
        LoaderKey key = new LoaderKey(namespace, prefix);
        SourceLoader loader = loaders.get(key);
        if (loader == null) {
            throw new AuraRuntimeException(String.format("Loader not found for %s", key));
        }
        return loader.find(primaryInterface, prefix, namespace);
    }
View Full Code Here

            FileUtils.copyFile(updatedFile, destination, false);
            String refresh = path.substring(path.indexOf("aura/resources"), path.length());
            Aura.getConfigAdapter().getResourceLoader().refreshCache(refresh);
            LOG.info("Updated resource file: " + relativePath);
        } catch (IOException ioe) {
            throw new AuraRuntimeException("Unable to refresh aura resources", ioe);
        }
    }
View Full Code Here

     * @throws IOException
     * @throws QuickFixException
     */
    private void write(AuraContext context, ClientLibraryDef.Type type, Appendable output) throws IOException, QuickFixException {
        if (output == null) {
            throw new AuraRuntimeException("Output cannot be null");
        }

        if (context == null) {
            throw new NoContextException();
        }
View Full Code Here

        StringBuilder sb = new StringBuilder();

        try {
            Aura.getSerializationService().write(context, null, AuraContext.class, sb, "HTML");
        } catch (IOException e) {
            throw new AuraRuntimeException(e);
        }

        String contextJson = AuraTextUtil.urlencode(sb.toString());
        path.append(contextJson).append("/resources.").append(type.toString().toLowerCase());
View Full Code Here

TOP

Related Classes of org.auraframework.throwable.AuraRuntimeException

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.