当前位置: 首页>>代码示例>>Java>>正文


Java AttributeList类代码示例

本文整理汇总了Java中javax.swing.text.html.parser.AttributeList的典型用法代码示例。如果您正苦于以下问题:Java AttributeList类的具体用法?Java AttributeList怎么用?Java AttributeList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AttributeList类属于javax.swing.text.html.parser包,在下文中一共展示了AttributeList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: noValueAttribute

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Handle attribute without value. The default method uses
 * the only allowed attribute value from DTD.
 * If the attribute is unknown or allows several values,
 * the HTML.NULL_ATTRIBUTE_VALUE is used. The attribute with
 * this value is added to the attribute set.
 * @param element The name of element.
 * @param attribute The name of attribute without value.
 */
protected void noValueAttribute(String element, String attribute)
{
  Object value = HTML.NULL_ATTRIBUTE_VALUE;

  Element e = dtd.elementHash.get(element.toLowerCase());
  if (e != null)
    {
      AttributeList attr = e.getAttribute(attribute);
      if (attr != null)
        {
          Vector values = attr.values;
          if (values != null && values.size() == 1)
            value = values.get(0);
        }
    }
  attributes.addAttribute(attribute, value);
}
 
开发者ID:vilie,项目名称:javify,代码行数:27,代码来源:Parser.java

示例2: testContentModelElement003

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for
 * 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.ContentModel(Element)'*
 * ContentModel(Element( "elemento",',',false,false,('*',new
 * ContentModel()),BitSet(0).set(1),BitSet(168).set(45),AttributeList("1") .
 * It checks if an instance is created, content is equal to el ,type is 0
 * and next is null.
 */
public void testContentModelElement003() {
    dtd = new DTDGetter("TestContentModelSemantic");
    ContentModel cm2 = new ContentModel('*', new ContentModel());
    BitSet bs1 = new BitSet(0);
    bs1.set(1);
    BitSet bs2 = new BitSet(168);
    bs2.set(45);
    AttributeList al = new AttributeList("1");
    Element el = dtd.defineElement("elemento", ',', false, false, cm2,
            bs1, bs2, al);
    cm = new ContentModel(el);
    assertNotNull(cm);
    assertEquals(el, cm.content);
    assertEquals(cm2, el.content);
    assertEquals(el, cm.content);
    assertEquals(0, cm.type);
    assertNull(cm.next);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:27,代码来源:ContentModelCompatilityTest.java

示例3: testContentModelElement004

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for
 * 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.ContentModel(Element)'*
 * ContentModel(Element( "",',',false,false,('*',new
 * ContentModel()),BitSet(128).set(1),BitSet(7),AttributeList("bigC",-2147483648,-1,"value",new
 * Vector(),new AttributeList(null)) . It checks if an instance is created,
 * content is equal to el ,type is 0 and next is null.
 */
public void testContentModelElement004() {
    dtd = new DTDGetter("TestContentModelSemantic");
    ContentModel cm2 = new ContentModel('*', new ContentModel());
    BitSet bs1 = new BitSet(128);
    bs1.set(1);
    BitSet bs2 = new BitSet(7);
    AttributeList al = new AttributeList("bigC", -2147483648, -1,
            "value", new Vector(), new AttributeList(null));
    Element el = dtd.defineElement("", '*', true, false, cm2, bs1, bs2,
            al);
    cm = new ContentModel(el);
    assertNotNull(cm);
    assertEquals(el, cm.content);
    assertEquals(cm2, el.content);
    assertEquals(el, cm.content);
    assertEquals(0, cm.type);
    assertNull(cm.next);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:27,代码来源:ContentModelCompatilityTest.java

示例4: testContentModelIntObjectContentModel045

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for
 * 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.ContentModel(int, Object,
 * ContentModel)' Parameters type=-38, (element is defined in a dtd as el=
 * "elemento",',',false,false,('*',new
 * ContentModel()),BitSet(0).set(1),BitSet(168).set(45),AttributeList("1")),
 * null Verifies that an instance is created. content is equal to element,
 * type is -38 and next is null
 */
public void testContentModelIntObjectContentModel045() {
    dtd = new DTDGetter("TestContentModelSemantic");
    ContentModel cm2 = new ContentModel('*', new ContentModel());
    BitSet bs1 = new BitSet(0);
    bs1.set(1);
    BitSet bs2 = new BitSet(168);
    bs2.set(45);
    AttributeList al = new AttributeList("1");
    Element el = dtd.defineElement("elemento", ',', false, false, cm2,
            bs1, bs2, al);
    cm = new ContentModel(-38, el, null);
    assertNotNull(cm);
    assertEquals(el, cm.content);
    assertEquals(-38, cm.type);
    assertNull(cm.next);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:26,代码来源:ContentModelCompatilityTest.java

示例5: testContentModelIntObjectContentModel047

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for
 * 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.ContentModel(int, Object,
 * ContentModel)' Parameters type=Integer.MIN_VALUE, el=
 * "",',',false,false,('*',new
 * ContentModel()),BitSet(128).set(1),BitSet(7),AttributeList("bigC",-2147483648,-1,"value",new
 * Vector(),new AttributeList(null)), null Verifies that an instance is
 * created. content is equal to el= "",',',false,false,('*',new
 * ContentModel()),BitSet(128).set(1),BitSet(7),AttributeList("bigC",-2147483648,-1,"value",new
 * Vector(),new AttributeList(null)), type is Integer.MIN_VALUE and next is
 * null
 */
public void testContentModelIntObjectContentModel047() {
    dtd = new DTDGetter("TestContentModelSemantic");
    ContentModel cm2 = new ContentModel('*', new ContentModel());
    BitSet bs1 = new BitSet(128);
    bs1.set(1);
    BitSet bs2 = new BitSet(7);
    AttributeList al = new AttributeList("bigC", -2147483648, -1,
            "value", new Vector(), new AttributeList(null));
    Element el = dtd.defineElement("", '*', true, false, cm2, bs1, bs2,
            al);
    cm = new ContentModel(Integer.MIN_VALUE, el, null);
    assertNotNull(cm);
    assertEquals(el, cm.content);
    assertEquals(Integer.MIN_VALUE, cm.type);
    assertNull(cm.next);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:29,代码来源:ContentModelCompatilityTest.java

示例6: testContentModelIntObjectContentModel080

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for
 * 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.ContentModel(int, Object,
 * ContentModel)' Parameters type=Integer.MIN_VALUE, el=
 * "",',',false,false,('*',new
 * ContentModel()),BitSet(128).set(1),BitSet(7),AttributeList("bigC",-2147483648,-1,"value",new
 * Vector(),new AttributeList(null)), new ContentModel() Verifies that an
 * instance is created. content is equal to el= "",',',false,false,('*',new
 * ContentModel()),BitSet(128).set(1),BitSet(7),AttributeList("bigC",-2147483648,-1,"value",new
 * Vector(),new AttributeList(null)), type is Integer.MIN_VALUE and next is
 * new ContentModel()
 */
public void testContentModelIntObjectContentModel080() {
    dtd = new DTDGetter("TestContentModelSemantic");
    ContentModel cmnext = new ContentModel();
    ContentModel cm2 = new ContentModel('*', new ContentModel());
    BitSet bs1 = new BitSet(128);
    bs1.set(1);
    BitSet bs2 = new BitSet(7);
    AttributeList al = new AttributeList("bigC", -2147483648, -1,
            "value", new Vector(), new AttributeList(null));
    Element el = dtd.defineElement("", '*', true, false, cm2, bs1, bs2,
            al);
    cm = new ContentModel(Integer.MIN_VALUE, el, cmnext);
    assertNotNull(cm);
    assertEquals(el, cm.content);
    assertEquals(Integer.MIN_VALUE, cm.type);
    assertEquals(cmnext, cm.next);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:30,代码来源:ContentModelCompatilityTest.java

示例7: testToString005

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.toString()'
 * ContentModel(Element("",'*',true,false,cm2,bs1,bs2,al)) ""
 */

public void testToString005() {
    dtd = new DTDGetter("TestContentModelSemantic");
    ContentModel cm2 = new ContentModel('*', new ContentModel());
    BitSet bs1 = new BitSet(128);
    bs1.set(1);
    BitSet bs2 = new BitSet(7);
    AttributeList al = new AttributeList("bigC", -2147483648, -1,
            "value", new Vector(), new AttributeList(null));
    Element el = dtd.defineElement("", '*', true, false, cm2, bs1, bs2,
            al);
    cm = new ContentModel(el);

    assertEquals("", cm.toString());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:20,代码来源:ContentModelCompatilityTest.java

示例8: testFirstObject005

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first(Object)'
 * ContentModel("elemento",',',false,false,('*',new
 * ContentModel()),BitSet(0).set(1),BitSet(168).set(45),AttributeList("1"))
 * "elemento",',',false,false,('*',new
 * ContentModel()),BitSet(0).set(1),BitSet(168).set(45),AttributeList("1")
 * Expected: true
 */
public void testFirstObject005() {
    dtd = new DTDGetter("TestContentModelSemantic");
    ContentModel cm2 = new ContentModel('*', new ContentModel());
    BitSet bs1 = new BitSet(0);
    bs1.set(1);
    BitSet bs2 = new BitSet(168);
    bs2.set(45);
    AttributeList al = new AttributeList("1");
    Element el = dtd.defineElement("elemento", ',', false, false, cm2,
            bs1, bs2, al);
    cm = new ContentModel(el);
    assertTrue(cm.first(el));
    assertFalse(cm.first(cm));
    assertFalse(cm.first(cm2));
    assertFalse(cm.first(dtd));

    assertFalse(cm.first(bs1));
    assertFalse(cm.first(bs2));
    assertFalse(cm.first(al));
    assertFalse(cm.first(""));
    assertFalse(cm.first("elemento"));
    assertFalse(cm.first(null));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:32,代码来源:ContentModelCompatilityTest.java

示例9: testFirstObject006

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first(Object)'
 * ContentModel("",',',false,false,('*',new
 * ContentModel()),BitSet(128).set(1),BitSet(7),AttributeList("bigC",-2147483648,-1,"value",new
 * Vector(),new AttributeList(null))) "",',',false,false,('*',new
 * ContentModel()),BitSet(128).set(1),BitSet(7),AttributeList("bigC",-2147483648,-1,"value",new
 * Vector(),new AttributeList(null)) Expected: true
 */

public void testFirstObject006() {
    dtd = new DTDGetter("TestContentModelSemantic");
    ContentModel cm2 = new ContentModel('*', new ContentModel());
    BitSet bs1 = new BitSet(128);
    bs1.set(1);
    BitSet bs2 = new BitSet(7);
    AttributeList al = new AttributeList("bigC", -2147483648, -1,
            "value", new Vector(), new AttributeList(null));
    Element el = dtd.defineElement("", '*', true, false, cm2, bs1, bs2,
            al);
    cm = new ContentModel(el);
    assertTrue(cm.first(el));
    assertFalse(cm.first(cm));
    assertFalse(cm.first(cm2));
    assertFalse(cm.first(dtd));

    assertFalse(cm.first(bs1));
    assertFalse(cm.first(bs2));
    assertFalse(cm.first(al));
    assertFalse(cm.first(""));
    assertFalse(cm.first(null));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:32,代码来源:ContentModelCompatilityTest.java

示例10: testGetElements004

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for
 * 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.getElements(Vector)'
 * ContentModel("elemento",',',false,false,('*',new
 * ContentModel()),BitSet(0).set(1),BitSet(168).set(45),AttributeList("1")).getElements(null)
 * Expected: NullPointerException
 */
public void testGetElements004() {
    try {
        dtd = new DTDGetter("TestContentModelSemantic");
        ContentModel cm2 = new ContentModel('*', new ContentModel());
        BitSet bs1 = new BitSet(0);
        bs1.set(1);
        BitSet bs2 = new BitSet(168);
        bs2.set(45);
        AttributeList al = new AttributeList("1");
        Element el = dtd.defineElement("elemento", ',', false, false, cm2,
                bs1, bs2, al);
        cm = new ContentModel(el);

        cm.getElements(null);

        fail("Should raise NullPointerException");
    } catch (NullPointerException e) {
        // Expected
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:28,代码来源:ContentModelCompatilityTest.java

示例11: testGetElements005

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for
 * 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.getElements(Vector)'
 * ContentModel("",',',false,false,('*',new
 * ContentModel()),BitSet(128).set(1),BitSet(7),AttributeList("bigC",-2147483648,-1,"value",new
 * Vector(),new AttributeList(null)).getElements(null) Expected:
 * NullPointerException
 */
public void testGetElements005() {
    try {
        dtd = new DTDGetter("TestContentModelSemantic");
        ContentModel cm2 = new ContentModel('*', new ContentModel());
        BitSet bs1 = new BitSet(128);
        bs1.set(1);
        BitSet bs2 = new BitSet(7);
        AttributeList al = new AttributeList("bigC", -2147483648, -1,
                "value", new Vector(), new AttributeList(null));
        Element el = dtd.defineElement("", '*', true, false, cm2, bs1, bs2,
                al);
        cm = new ContentModel(el);
        cm.getElements(null);
        fail("Should raise NullPointerException");
    } catch (NullPointerException e) {
        // Expected
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:27,代码来源:ContentModelCompatilityTest.java

示例12: testGetElements010

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for
 * 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.getElements(Vector)'
 * ContentModel("elemento",',',false,false,('*',new
 * ContentModel()),BitSet(0).set(1),BitSet(168).set(45),AttributeList("1")).getElements(new
 * Vector()) Expected: "elemento"
 */
public void testGetElements010() {
    dtd = new DTDGetter("TestContentModelSemantic");
    ContentModel cm2 = new ContentModel('*', new ContentModel());
    BitSet bs1 = new BitSet(0);
    bs1.set(1);
    BitSet bs2 = new BitSet(168);
    bs2.set(45);
    AttributeList al = new AttributeList("1");
    Element el = dtd.defineElement("elemento", ',', false, false, cm2,
            bs1, bs2, al);
    cm = new ContentModel(el);
    Vector v = new Vector();
    cm.getElements(v);
    assertEquals("[elemento]", v.toString());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:23,代码来源:ContentModelCompatilityTest.java

示例13: testGetElements011

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for
 * 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.getElements(Vector)'
 * ContentModel("",',',false,false,('*',new
 * ContentModel()),BitSet(128).set(1),BitSet(7),AttributeList("bigC",-2147483648,-1,"value",new
 * Vector(),new AttributeList(null)).getElements(new Vector()) Expected: ""
 */
public void testGetElements011() {
    dtd = new DTDGetter("TestContentModelSemantic");
    ContentModel cm2 = new ContentModel('*', new ContentModel());
    BitSet bs1 = new BitSet(128);
    bs1.set(1);
    BitSet bs2 = new BitSet(7);
    AttributeList al = new AttributeList("bigC", -2147483648, -1,
            "value", new Vector(), new AttributeList(null));
    Element el = dtd.defineElement("", '*', true, false, cm2, bs1, bs2,
            al);
    cm = new ContentModel(el);
    Vector v = new Vector();
    cm.getElements(v);
    assertEquals("[]", v.toString());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:23,代码来源:ContentModelCompatilityTest.java

示例14: testGetElements014

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for
 * 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.getElements(Vector)'
 * ContentModel("elemento",',',false,false,('*',new
 * ContentModel()),BitSet(0).set(1),BitSet(168).set(45),AttributeList("1")).getElements(new
 * Vector()) method is called 4 times Expected: "[elemento, elemento,
 * elemento, elemento]"
 */
public void testGetElements014() {
    dtd = new DTDGetter("TestContentModelSemantic");
    ContentModel cm2 = new ContentModel('*', new ContentModel());
    BitSet bs1 = new BitSet(0);
    bs1.set(1);
    BitSet bs2 = new BitSet(168);
    bs2.set(45);
    AttributeList al = new AttributeList("1");
    Element el = dtd.defineElement("elemento", ',', false, false, cm2,
            bs1, bs2, al);
    cm = new ContentModel(el);
    Vector v = new Vector();
    cm.getElements(v);
    cm.getElements(v);
    cm.getElements(v);
    cm.getElements(v);
    assertEquals("[elemento, elemento, elemento, elemento]", v
            .toString());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:28,代码来源:ContentModelCompatilityTest.java

示例15: testContentModelElement003

import javax.swing.text.html.parser.AttributeList; //导入依赖的package包/类
/**
 * Test method for
 * 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.ContentModel(Element)'*
 * ContentModel(Element( "elemento",',',false,false,('*',new
 * ContentModel()),BitSet(0).set(1),BitSet(168).set(45),AttributeList("1") .
 * It checks if an instance is created, content is equal to el ,type is 0
 * and next is null.
 */
public void testContentModelElement003() {
    try {
        dtd = new DTDGetter("TestContentModelSemantic");
        ContentModel cm2 = new ContentModel('*', new ContentModel());
        BitSet bs1 = new BitSet(0);
        bs1.set(1);
        BitSet bs2 = new BitSet(168);
        bs2.set(45);
        AttributeList al = new AttributeList("1");
        Element el = dtd.defineElement("elemento", ',', false, false, cm2,
                bs1, bs2, al);
        cm = new ContentModel(el);
        assertNotNull(cm);
        assertEquals(el, cm.content);
        assertEquals(cm2, el.content);
        assertEquals(el, cm.content);
        assertEquals(0, cm.type);
        assertNull(cm.next);

    } catch (Exception e) {
        fail("Should not throw any exception but was: " + e);
    }
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:32,代码来源:ContentModelCompatilityTest.java


注:本文中的javax.swing.text.html.parser.AttributeList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。