Package cambridge.model

Examples of cambridge.model.ComplexAttribute


                        if (fragments.size() == 0 || fragments.size() == 1 && fragments.get(0) instanceof StaticFragment) {
                           element = new SimpleAttribute(currentToken.getLineNo(), currentToken.getColumn());
                           ((SimpleAttribute) element).setValue(currentToken.value);
                        } else {
                           element = new ComplexAttribute(currentToken.getLineNo(), currentToken.getColumn());
                           ((ComplexAttribute) element).setFragments(fragments);
                           AttributeValueToken aTok = (AttributeValueToken) currentToken;
                           if (aTok.getQuotes() == -2) {
                              ((ComplexAttribute) element).setQuote('"');
                           } else if (aTok.getQuotes() == -3) {
View Full Code Here


         assertNotNull(t);

         Attribute a = t.locateTag("/div").getAttribute("class");
         assertTrue(a instanceof ComplexAttribute);

         ComplexAttribute c = (ComplexAttribute) a;

         assertEquals(1, c.getFragments().size());

         assertTrue(c.getFragments().get(0) instanceof ExpressionNode);

         ExpressionNode node = (ExpressionNode) c.getFragments().get(0);

         assertEquals("${class}", node.getSource());

         StringWriter builder = new StringWriter();
View Full Code Here

         assertNotNull(t);

         Attribute a = t.locateTag("/div").getAttribute("id");
         assertTrue(a instanceof ComplexAttribute);

         ComplexAttribute c = (ComplexAttribute) a;

         assertEquals(4, c.getFragments().size());

         assertTrue(c.getFragments().get(0) instanceof ExpressionNode);
         assertTrue(c.getFragments().get(1) instanceof StaticFragment);
         assertTrue(c.getFragments().get(2) instanceof StaticFragment);
         assertTrue(c.getFragments().get(3) instanceof ExpressionNode);

         ExpressionNode node1 = (ExpressionNode) c.getFragments().get(0);
         StaticFragment st = (StaticFragment) c.getFragments().get(1);
         StaticFragment st2 = (StaticFragment) c.getFragments().get(2);
         ExpressionNode node2 = (ExpressionNode) c.getFragments().get(3);

         assertEquals("${a}", node1.getSource());
         assertEquals(" ", st.toString());
         assertEquals("and ", st2.toString());
         assertEquals("${b}", node2.getSource());
View Full Code Here

         assertNotNull(t);

         Attribute a = t.locateTag("/div").getAttribute("style");
         assertTrue(a instanceof ComplexAttribute);

         ComplexAttribute c = (ComplexAttribute) a;

         assertEquals(1, c.getFragments().size());

         assertTrue(c.getFragments().get(0) instanceof ExpressionNode);

         ExpressionNode node1 = (ExpressionNode) c.getFragments().get(0);

         assertEquals("${style}", node1.getSource());

         StringWriter builder = new StringWriter();
View Full Code Here

         assertNotNull(t);

         Attribute a = t.locateTag("/div").getAttribute("class");
         assertTrue(a instanceof ComplexAttribute);

         ComplexAttribute c = (ComplexAttribute) a;

         assertEquals(1, c.getFragments().size());

         assertTrue(c.getFragments().get(0) instanceof ExpressionNode);

         ExpressionNode node = (ExpressionNode) c.getFragments().get(0);

         assertEquals("${class}", node.getSource());

         StringWriter builder = new StringWriter();
View Full Code Here

         assertNotNull(t);

         Attribute a = t.locateTag("/div").getAttribute("id");
         assertTrue(a instanceof ComplexAttribute);

         ComplexAttribute c = (ComplexAttribute) a;

         assertEquals(4, c.getFragments().size());

         assertTrue(c.getFragments().get(0) instanceof ExpressionNode);
         assertTrue(c.getFragments().get(1) instanceof StaticFragment);
         assertTrue(c.getFragments().get(2) instanceof StaticFragment);
         assertTrue(c.getFragments().get(3) instanceof ExpressionNode);

         ExpressionNode node1 = (ExpressionNode) c.getFragments().get(0);
         StaticFragment st = (StaticFragment) c.getFragments().get(1);
         StaticFragment st2 = (StaticFragment) c.getFragments().get(2);
         ExpressionNode node2 = (ExpressionNode) c.getFragments().get(3);

         assertEquals("${a}", node1.getSource());
         assertEquals(" ", st.toString());
         assertEquals("and ", st2.toString());
         assertEquals("${b}", node2.getSource());
View Full Code Here

         assertNotNull(t);

         Attribute a = t.locateTag("/div").getAttribute("style");
         assertTrue(a instanceof ComplexAttribute);

         ComplexAttribute c = (ComplexAttribute) a;

         assertEquals(1, c.getFragments().size());

         assertTrue(c.getFragments().get(0) instanceof ExpressionNode);

         ExpressionNode node1 = (ExpressionNode) c.getFragments().get(0);

         assertEquals("${style}", node1.getSource());

         StringWriter builder = new StringWriter();
View Full Code Here

                                if (fragments.size() == 0 || fragments.size() == 1 && fragments.get(0) instanceof StaticFragment) {
                                    element = new SimpleAttribute(currentToken.getLineNo(), currentToken.getColumn());
                                    ((SimpleAttribute) element).setValue(currentToken.value);
                                } else {
                                    element = new ComplexAttribute(currentToken.getLineNo(), currentToken.getColumn());
                                    ((ComplexAttribute) element).setFragments(fragments);
                                    AttributeValueToken aTok = (AttributeValueToken) currentToken;
                                    if (aTok.getQuotes() == -2) {
                                        ((ComplexAttribute) element).setQuote('"');
                                    } else if (aTok.getQuotes() == -3) {
View Full Code Here

TOP

Related Classes of cambridge.model.ComplexAttribute

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.