Package org.auraframework.system

Examples of org.auraframework.system.Location


    public PropertyReferenceImplTest(String name) {
        super(name);
    }

    public void testExpression() throws Exception {
        Location loc = new Location("expressionism", 456);
        PropertyReferenceImpl pr = new PropertyReferenceImpl("test.yo.self", loc);
        assertSame(loc, pr.getLocation());
        assertEquals("root was not correct", "test", pr.getRoot());
        assertEquals(3, pr.size());
        List<String> l = pr.getList();
View Full Code Here


        assertEquals("root was not correct", "self", pr3.getRoot());
        assertEquals(1, pr3.size());
    }

    public void testSimpleExpression() throws Exception {
        Location loc = new Location("expressionism", 92);
        PropertyReferenceImpl pr = new PropertyReferenceImpl("inohaveanydots", loc);
        assertSame(loc, pr.getLocation());
        assertEquals("root was not correct", "inohaveanydots", pr.getRoot());
        assertEquals(1, pr.size());
        assertNull("stem should have been null", pr.getStem());
View Full Code Here

        assertEquals(1, pr.size());
        assertNull("stem should have been null", pr.getStem());
    }

    public void testToString() throws Exception {
        Location loc = new Location("expressionism", 92);
        PropertyReferenceImpl pr = new PropertyReferenceImpl("test.yo.self", loc);
        assertEquals("{!test.yo.self}", pr.toString(true));
        assertEquals("test.yo.self", pr.toString());
    }
View Full Code Here

        if (c == null) {
            return null;
        }
        if (!c.isAnnotationPresent(Model.class)) {
            throw new InvalidDefinitionException(String.format(
                    "@Model annotation is required on all Models.  Not found on %s", descriptor), new Location(
                    descriptor.getName(), 0));
        }

        JavaModelDefImpl.Builder builder = new JavaModelDefImpl.Builder();
        builder.setDescriptor(descriptor);
View Full Code Here

     *
     * @param name a string to identify the external source
     * @return the location
     */
    public static Location getExternalLocation(String name) {
        return new Location(name, -1);
    }
View Full Code Here

                    String qn = "java://" + formatType(genParams[i]);
                    DefDescriptor<TypeDef> typeDefDesc = DefDescriptorImpl.getInstance(qn, TypeDef.class);

                    // FIXME = "we need an md5";
                    String paramName = ((Key) annotation).value();
                    ValueDef valueDef = new JavaValueDef(paramName, typeDefDesc, new Location(
                            controllerClass.getName() + "." + name, 0));
                    params.add(valueDef);
                   
                    if (((Key)annotation).loggable()) {
                        loggableParams.add(paramName);
                    }
                }
            }
            if (!found) {
                throw new InvalidDefinitionException("@Key annotation is required on all action parameters",
                        new Location(controllerClass.getName() + "." + name, 0));
            }
        }
        actionBuilder.setParams(params);
        actionBuilder.setLoggableParams(loggableParams);
       
View Full Code Here

        return actionBuilder.build();
    }

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

                JavaActionDef action = makeActionDef(method, controllerClass, controllerDesc);

                if (action != null) {
                    // this line disallows action overloading. dunno if we care.
                    if (actions.containsKey(action.getName())) {
                        throw new InvalidDefinitionException("Duplicate action " + action.getName(), new Location(
                                controllerClass.getName(), 0));
                    }
                    actions.put(action.getName(), action);
                }
            }
View Full Code Here

        }

        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();
        builder.setDescriptor(descriptor);
        builder.setLocation(providerClass.getCanonicalName(), 0);
View Full Code Here

        if (t instanceof AuraHandledException) {
            this.errors.add(t);
        } else {
            Throwable ex = t;
            if (wrap) {
                ex = new AuraExecutionException(ex, new Location(controllerDescriptor.toString(), 0));
            }
            if (loggable) {
                ex = Aura.getExceptionAdapter().handleException(ex, this);
            }
            this.errors.add(ex);
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.