1 16 17 package org.apache.cocoon.components.modules.input; 18 19 import org.apache.avalon.framework.configuration.Configuration; 20 import org.apache.avalon.framework.configuration.ConfigurationException; 21 import org.apache.avalon.framework.thread.ThreadSafe; 22 23 import java.util.Iterator ; 24 import java.util.LinkedList ; 25 import java.util.List ; 26 import java.util.Map ; 27 import java.util.Vector ; 28 29 36 public class StringConstantModule extends AbstractInputModule implements ThreadSafe { 37 38 final static Vector returnNames; 39 static { 40 Vector tmp = new Vector (); 41 tmp.add("stringConstant"); 42 returnNames = tmp; 43 } 44 45 public Object getAttribute( String name, Configuration modeConf, Map objectModel ) throws ConfigurationException { 46 47 if (modeConf == null) { 48 return null; 49 } else { 50 return modeConf.getValue(); 51 } 52 } 53 54 55 public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException { 56 57 return StringConstantModule.returnNames.iterator(); 58 } 59 60 61 public Object [] getAttributeValues( String name, Configuration modeConf, Map objectModel ) 62 throws ConfigurationException { 63 64 List values = new LinkedList (); 65 values.add( this.getAttribute(name, modeConf, objectModel) ); 66 67 return values.toArray(); 68 69 } 70 71 } 72 | Popular Tags |