Examples of parseAttributes()


Examples of com.granule.parser.TagReader.parseAttributes()

    TagReader s;
    Element includeTag;
    Attributes includeAttributes;
    s = new TagReader(text);
        includeTag = s.getAllElements().get(tagPosition);
        includeAttributes = s.parseAttributes(includeTag);
        assertEquals(includeAttributes.isValueExists("include"), true);
        assertEquals(includeAttributes.getValue("file"), "ff.inc");
  }

    public void testComplexOne() {
View Full Code Here

Examples of com.granule.parser.TagReader.parseAttributes()

            if (e.getName() != null && e.getName().equalsIgnoreCase("%"))
                jspTags++;
            else if (e.getName() != null && e.getName().equals("g:compress")) gCompressPos = all.indexOf(e);
        assertEquals(jspTags, 3);
        Element pageTag = all.get(1);
        Attributes pageAttributes = s.parseAttributes(pageTag);
        assertEquals(pageAttributes.isValueExists("include"), false);
        assertEquals(pageAttributes.isValueExists("file"), false);

        Element includeTag = all.get(2);
        Attributes includeAttributes = s.parseAttributes(includeTag);
View Full Code Here

Examples of com.granule.parser.TagReader.parseAttributes()

        Attributes pageAttributes = s.parseAttributes(pageTag);
        assertEquals(pageAttributes.isValueExists("include"), false);
        assertEquals(pageAttributes.isValueExists("file"), false);

        Element includeTag = all.get(2);
        Attributes includeAttributes = s.parseAttributes(includeTag);
        assertEquals(includeAttributes.isValueExists("include"), true);
        assertEquals(includeAttributes.isValueExists("file"), true);
        assertEquals(includeTag.getBegin(), text.indexOf("<%@ include"));
        assertEquals(includeTag.getEnd(), text.indexOf("<%@ include") + "<%@ include file=\"includes/test1.inc\"%>".length());
View Full Code Here

Examples of com.granule.parser.TagReader.parseAttributes()

        assertEquals(includeAttributes.isValueExists("file"), true);
        assertEquals(includeTag.getBegin(), text.indexOf("<%@ include"));
        assertEquals(includeTag.getEnd(), text.indexOf("<%@ include") + "<%@ include file=\"includes/test1.inc\"%>".length());

        Element gCompress = all.get(gCompressPos);
        Attributes gCompressAttrs = s.parseAttributes(gCompress);
        assertEquals(gCompressAttrs.isValueExists("dsdsd"), false);
        assertEquals(gCompressAttrs.isValueExists("method"), true);
        assertEquals(gCompressAttrs.get("method").getBegin(), text.indexOf("method="));
        assertEquals(gCompressAttrs.get("method").getEnd(), text.indexOf("method=") + "method=\"closure-compiler\"".length());
        assertEquals(gCompress.getBegin(), text.indexOf("<g:compress"));
View Full Code Here

Examples of com.granule.parser.TagReader.parseAttributes()

        List<Element> els = source.getAllElements();
        for (Element el : els) {
            if (el.getName().equals(settings.getTagName())) {
                try {
                    String body = el.getContentAsString();
                    Attributes attrs = source.parseAttributes(el);
                    String id = attrs.getValue("id");
                    String method = attrs.getValue("method");
                    String options = attrs.getValue("options");
                    String basepath = attrs.getValue("basepath");
                    if (body == null) body = "";
View Full Code Here

Examples of com.granule.parser.TagReader.parseAttributes()

                } catch (JSCompileException e) {
                    errorCount++;
                    logger.error("Tag process exception:", e);
                }
            } else if (el.getName().equals("%")) {
                Attributes attrs = source.parseAttributes(el);
                if (attrs != null && attrs.isValueExists("include") && attrs.isValueExists("file")) {
                    String file = attrs.getValue("file");
                    String pa = "";
                    if (!file.trim().startsWith("/") && file.indexOf("/")>=0)
                        pa = file.substring(0, file.lastIndexOf("/")+1);
View Full Code Here

Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader.parseAttributes()

            + "description:: V2hhdCBhIGNhcmVmdWwgcmVhZGVyIHlvdSBhcmUhICBUaGlzIHZhbHVl\n"
            + " IGlzIGJhc2UtNjQtZW5jb2RlZCBiZWNhdXNlIGl0IGhhcyBhIGNvbnRyb2wgY2hhcmFjdG\n"
            + " VyIGluIGl0IChhIENSKS4NICBCeSB0aGUgd2F5LCB5b3Ugc2hvdWxkIHJlYWxseSBnZXQg\n" + " b3V0IG1vcmUu";

        LdifAttributesReader reader = new LdifAttributesReader();
        Attributes attributes = reader.parseAttributes( ldif );

        javax.naming.directory.Attribute attr = attributes.get( "objectclass" );
        assertTrue( attr.contains( "top" ) );
        assertTrue( attr.contains( "person" ) );
        assertTrue( attr.contains( "organizationalPerson" ) );
View Full Code Here

Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader.parseAttributes()

            + "description::  V2hhdCBhIGNhcmVmdWwgcmVhZGVyIHlvdSBhcmUhICBUaGlzIHZhbHVl\n"
            + " IGlzIGJhc2UtNjQtZW5jb2RlZCBiZWNhdXNlIGl0IGhhcyBhIGNvbnRyb2wgY2hhcmFjdG\n"
            + " VyIGluIGl0IChhIENSKS4NICBCeSB0aGUgd2F5LCB5b3Ugc2hvdWxkIHJlYWxseSBnZXQg\n" + " b3V0IG1vcmUu  ";

        LdifAttributesReader reader = new LdifAttributesReader();
        Attributes attributes = reader.parseAttributes( ldif );

        javax.naming.directory.Attribute attr = attributes.get( "objectclass" );
        assertTrue( attr.contains( "top" ) );
        assertTrue( attr.contains( "person" ) );
        assertTrue( attr.contains( "organizationalPerson" ) );
View Full Code Here

Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader.parseAttributes()

            + "ou;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2\n"
            + "# ou;lang-ja:: ������������������\n" + "ou;lang-en: Sales\n"
            + "description: Japanese office\n";

        LdifAttributesReader reader = new LdifAttributesReader();
        Attributes attributes = reader.parseAttributes( ldif );

        String[][] values =
            {
                { "objectclass", "top" },
                { "objectclass", "organizationalUnit" },
View Full Code Here

Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader.parseAttributes()

        String ldif = "objectclass: top\n" + "objectclass: person\n" + "objectclass: organizationalPerson\n"
            + "cn: Horatio Jensen\n" + "cn: Horatio N Jensen\n" + "sn: Jensen\n" + "uid: hjensen\n"
            + "telephonenumber: +1 408 555 1212\n" + "jpegphoto:< file:" + HJENSEN_JPEG_FILE.getAbsolutePath() + "\n";

        LdifAttributesReader reader = new LdifAttributesReader();
        Attributes attributes = reader.parseAttributes( ldif );

        String[][] values =
            {
                { "objectclass", "top" },
                { "objectclass", "person" },
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.