Package org.auraframework.system

Examples of org.auraframework.system.Location


    @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


    static ValidationError make(String filename, AuraValidationException e) {
        if (e instanceof StyleParserException) {
            return parseCSSParserError(filename, e);
        }

        Location location = e.getLocation();
        String suffix = filename.substring(filename.lastIndexOf('.') + 1);
        int line = location.getLine();
        if (line == 0) {
            line = 1;
        }
        String message = e.getMessage();
        if (message == null || message.length() == 0)
            message = e.toString();
        // TODO: location may have be for a different filename than the one we are checkin
        return new AuraValidationError(suffix + "/custom", filename, line, location.getColumn(),
                message);
    }
View Full Code Here

            // We need to walk the whole tree, which is unfortunate perf-wise.
            //
            if (cd.def == null) {
                if (!fillCompilingDef(cd, cc.context)) {
                    // No def. Blow up.
                    Location l = null;
                    if (parent != null) {
                        l = parent.getLocation();
                    }
                    stack.remove(descriptor);
                    throw new DefinitionNotFoundException(descriptor, l, stack.toString());
View Full Code Here

        this.source = source;
        this.descriptor = descriptor;
    }

    protected Location getLocation() {
        return new Location(source.getSystemId(), source.getLastModified());
    }
View Full Code Here

    private JavascriptActionDef createActionDef(String name, JsFunction f) {
        JavascriptActionDef.Builder builder = new JavascriptActionDef.Builder();
        builder.setDescriptor(SubDefDescriptorImpl.getInstance(name, getDescriptor(), ActionDef.class));
        builder.function = f;
        builder.setLocation(new Location(source.getSystemId(), f.getLine(), f.getCol(), source.getLastModified()));
        return builder.build();
    }
View Full Code Here

        return buildValidatedClass(def.getJavaType());
    }

    private static void throwConstructorError(String message, Class<?> clazz) throws QuickFixException {
        throw new InvalidDefinitionException(message,
                new Location("java://" + clazz.getCanonicalName(), 0));
    }
View Full Code Here

    private static DefDescriptor<TypeDef> getReturnTypeDescriptor(Method method) throws QuickFixException {
        int modifiers = method.getModifiers();

        if (!Modifier.isPublic(modifiers) || Modifier.isStatic(modifiers) || method.getParameterTypes().length > 0) {
            throw new InvalidDefinitionException(String.format("@AuraEnabled annotation found on invalid method %s",
                    method.getName()), new Location("java://" + method.getDeclaringClass().getCanonicalName(), 0));
        }
        Type type = method.getAnnotation(Type.class);
        if (type == null) {
            //
            // FIXME: need better checks here, including doing things like
            // List<Type>, arrays also need to be handled here.
            //
            if (Void.TYPE.equals(method.getGenericReturnType())) {
                throw new InvalidDefinitionException(String.format("@AuraEnabled annotation found on void method %s",
                        method.getName()), new Location("java://" + method.getDeclaringClass().getCanonicalName(), 0));
            }
            return DefDescriptorImpl.getInstance("java://" + method.getReturnType().getName(), TypeDef.class);
        } else {
            return DefDescriptorImpl.getInstance(type.value(), TypeDef.class);
        }
View Full Code Here

        protected void addMethod(Method method) throws QuickFixException {
            String name = JavaValueDef.getMemberName(method.getName());
            DefDescriptor<TypeDef> typeDescriptor = getReturnTypeDescriptor(method);

            JavaValueDef member = new JavaValueDef(name, method, typeDescriptor,
                    new Location(this.modelClass.getName() + "." + name, 0));
            this.memberMap.put(name, member);
        }
View Full Code Here

            String expression = expression(raw.args());

            if (passthrough) {
                broadcaster.broadcast(new GenericFunctionValue(raw.line(), raw.column(), NORMAL, expression));
            } else {
                Location location = new Location(null, raw.line(), raw.column(), -1);
                String evaluated = provider.getValue(expression, location).toString();
                if (evaluated.isEmpty()) {
                    broadcaster.broadcast(new EmptyTerm(expression));
                } else {
                    Source source = new Source(evaluated.toString(), raw.line(), raw.column());
View Full Code Here

            String expression = expression(Args.extract(raw));

            if (passthrough) {
                atRule.expression(new GenericAtRuleExpression(NORMAL_FUNCTION + expression + ")"));
            } else {
                Object evaluated = provider.getValue(expression, new Location(null, line, col, -1));

                // cannot be empty
                if (AuraTextUtil.isEmptyOrWhitespace(evaluated.toString())) {
                    throw new ParserException(atRule, String.format(INVALID_EMPTY, expression));
                }
View Full Code Here

TOP

Related Classes of org.auraframework.system.Location

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.