Commons Attributes -


Apache
跨平台
Java

软件简介

Commons Attributes enables Java programmers to use C#/.Net-style attributes in
their code.

示例代码:

/
Make this attribute inheritable…

@@Inheritable()
/
public class MyAttribute {
private final float value;

public MyAttribute( float value ) {
this.value = value;
}

public float getValue() {
return value;
}
}

/
Add a MyAttribute with value 0.8.

@@MyAttribute( 0.8 )
/
public class MyClass {
public static void main( String[] args ) {
System.out.println( “MyClass has the following attributes:” +
Attributes.getAttributes( MyClass.class ) );
}
}