Package org.auraframework.impl.root.parser.handler

Examples of org.auraframework.impl.root.parser.handler.ComponentDefHandler


    @SuppressWarnings("rawtypes")
    public XMLWriter() {
        handlers.put(ApplicationDefImpl.class, new ApplicationDefHandler());
        handlers.put(AttributeDefImpl.class, new AttributeDefHandler());
        handlers.put(AttributeDefRefImpl.class, new AttributeDefRefHandler());
        handlers.put(ComponentDefImpl.class, new ComponentDefHandler());
        handlers.put(ComponentDefRefImpl.class, new ComponentDefRefHandler());
        handlers.put(EventDefImpl.class, new EventDefHandler());
        handlers.put(EventHandlerDefImpl.class, new EventHandlerDefHandler());
        handlers.put(LibraryDefImpl.class, new LibraryDefHandler());
        handlers.put(ImportDefImpl.class, new ImportDefHandler());
View Full Code Here


    }

    private ClientLibraryDefHandler<ComponentDef> getHandler(String clMarkup) throws Exception {
        StringSource<ClientLibraryDef> componentSource = new StringSource<>(null, "<aura:component/>", "myID", Format.XML);
        XMLStreamReader componentXmlReader = getXmlReader(componentSource);
        ComponentDefHandler cdh = new ComponentDefHandler(null, componentSource, componentXmlReader);
       
        StringSource<ClientLibraryDef> clientLibrarySource = new StringSource<>(null, clMarkup, "myID",
                Format.XML);
        XMLStreamReader xmlReader = getXmlReader(clientLibrarySource);
        return new ClientLibraryDefHandler<>(cdh, xmlReader,
View Full Code Here

        }
    }

    public void testAsValues() throws Exception {
        TextTokenizer tokenizer = TextTokenizer.tokenize(wholeText, null);
        ComponentDefHandler cdh = new ComponentDefHandler(null, null, null);
        try {
            tokenizer.asValue(cdh);
            fail("Should have failed because of mixed expression and text");
        } catch (Exception e) {
            checkExceptionStart(e, InvalidExpressionException.class,
View Full Code Here

        }
    }

    public void testSingleAsValue() throws Exception {
        TextTokenizer tokenizer = TextTokenizer.tokenize(testText[0], null);
        ComponentDefHandler cdh = new ComponentDefHandler(null, null, null);
        Object o = tokenizer.asValue(cdh);
        assertTrue("Token value is of wrong type", o instanceof String);
        assertEquals("Incorrect value returned from asValue()", testText[0], o.toString());

        tokenizer = TextTokenizer.tokenize(testText[1], null);
View Full Code Here

        assertEquals("Incorrect value returned from asValue()", testText[1], e.toString(true));
    }

    public void testAsComponentDefRefs() throws Exception {
        TextTokenizer tokenizer = TextTokenizer.tokenize(wholeText, null);
        ComponentDefHandler cdh = new ComponentDefHandler(null, null, null);
        List<ComponentDefRef> l = tokenizer.asComponentDefRefs(cdh);
        assertEquals("Wrong number of ComponentDefRefs returned", 3, l.size());
        ComponentDefRef c = l.get(0);
        assertEquals("Incorrect ComponentDefRef type", "text", c.getDescriptor().getName());
        assertEquals("Incorrect ComponentDefRef value", testText[0], c.getAttributeDefRef("value").getValue());
View Full Code Here

                "[value=org.auraframework.impl.expression.LiteralImpl", //
                "[value=     ]", //
                "[value=org.auraframework.impl.expression.LiteralImpl", //
                "[value=     five spaces]" };

        ComponentDefHandler cdh = new ComponentDefHandler(null, null, null);
        List<ComponentDefRef> compList = TextTokenizer.tokenize(testWhitespace, null, WhitespaceBehavior.PRESERVE)
                .asComponentDefRefs(cdh);
        assertEquals("Wrong number of ComponentDefRefs returned", descNames.length, compList.size());
        int i = 0;
        for (ComponentDefRef cdf : compList) {
View Full Code Here

    public void testWhitespaceOptimize() throws Exception {
        String[] descNames = new String[] { "expression", "expression", "text" };
        String[] testResults = new String[] { "[value=org.auraframework.impl.expression.LiteralImpl",
                "[value=org.auraframework.impl.expression.LiteralImpl", "[value=     five spaces]" };

        ComponentDefHandler cdh = new ComponentDefHandler(null, null, null);
        List<ComponentDefRef> compList = TextTokenizer.tokenize(testWhitespace, null, WhitespaceBehavior.OPTIMIZE)
                .asComponentDefRefs(cdh);
        assertEquals("Wrong number of ComponentDefRefs returned", descNames.length, compList.size());
        int i = 0;
        for (ComponentDefRef cdf : compList) {
View Full Code Here

TOP

Related Classes of org.auraframework.impl.root.parser.handler.ComponentDefHandler

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.