Java 8 Annotation - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Annotation class.

This code example shows how to use the following methods:getValue
 
	/** 
	 * @tests java.text.Annotation.getValue() 
	 */ 
	public void testGetValue() { 
		Annotation a = new Annotation(null);
		assertNull(a.getValue());
		a = new Annotation("value");
		assertEquals("value", a.getValue());
	} 
 
	/** 
	 * @tests java.text.Annotation.toString() 
	 */ 
	public void testToString() { 
        Annotation ant = new Annotation("HelloWorld");
        assertEquals("toString error.",
                     "java.text.Annotation[value=HelloWorld]",ant.toString());
        assertNotNull(new Annotation(null).toString());
        assertNotNull(new Annotation("value").toString());
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:toString
 
    public void testAttributeNames() { 
        assertEquals("java.awt.font.TextAttribute(kerning)",
                TextAttribute.KERNING.toString());
        assertEquals("java.awt.font.TextAttribute(ligatures)",
                TextAttribute.LIGATURES.toString());
        assertEquals("java.awt.font.TextAttribute(tracking)",
                TextAttribute.TRACKING.toString());
    } 
 
    public void testAttributeValues() { 
        assertEquals(new Integer(1), TextAttribute.KERNING_ON);
        assertEquals(new Integer(1), TextAttribute.LIGATURES_ON);
        assertEquals(new Float(0.04f), TextAttribute.TRACKING_LOOSE);
        assertEquals(new Float(-0.04f), TextAttribute.TRACKING_TIGHT);
    } 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Java 8 Annotation Methods: