1 29 package net.sourceforge.groboutils.pmti.v1.defimpl; 30 31 import net.sourceforge.groboutils.pmti.v1.IAttributeInfo; 32 33 42 public class DefaultAttributeInfo implements IAttributeInfo 43 { 44 private String name; 45 private String desc; 46 private Class [] types; 47 48 49 public DefaultAttributeInfo( String n, String d, Class [] t ) 50 { 51 if (n == null) 52 { 53 throw new IllegalArgumentException ("no null arguments"); 54 } 55 this.types = copyClasses( t ); 56 57 this.name = n; 58 this.desc = d; 59 } 60 61 62 63 66 public String getName() 67 { 68 return this.name; 69 } 70 71 72 75 public String getDescription() 76 { 77 return this.desc; 78 } 79 80 81 90 public Class [] getValueTypes() 91 { 92 return copyClasses( this.types ); 93 } 94 95 96 private Class [] copyClasses( Class [] c ) 97 { 98 if (c == null) 99 { 100 throw new IllegalArgumentException ("no null arguments"); 101 } 102 Class [] ret = new Class [ c.length ]; 103 System.arraycopy( c, 0, ret, 0, c.length ); 104 return ret; 105 } 106 } 107 108 | Popular Tags |