1 package jfun.yan.xml.nuts; 2 3 import java.util.List ; 4 import java.util.Properties ; 5 6 import jfun.yan.Component; 7 import jfun.yan.Components; 8 import jfun.yan.SimpleComponent; 9 10 16 public class PropertiesNut extends EntriesNut { 17 public PropertiesNut(){ 18 super.setKey_type(String .class); 19 super.setOf(String .class); 20 } 21 22 25 public void setKey_type(Class key_type) { 26 throw raise("attribute \"key-type\" not supported."); 27 } 28 29 32 public void setOf(Class of) { 33 throw raise("attribute \"of\" not supported."); 34 } 35 36 public Component eval(){ 37 final List keys = getKeys(); 38 final Component[] vals = getEntryComponents(); 39 final Component step1 = new SimpleComponent(Properties .class){ 40 public Object create(){ 41 return new Properties (); 42 } 43 }; 44 return Components.storeMap(step1, keys.toArray(), vals); 45 } 46 } 47 | Popular Tags |