1 7 8 package com.sun.corba.se.impl.orb ; 9 10 import java.util.Properties ; 11 12 import com.sun.corba.se.spi.orb.StringPair ; 13 import com.sun.corba.se.spi.orb.Operation ; 14 import com.sun.corba.se.spi.orb.PropertyParser ; 15 16 public class PrefixParserData extends ParserDataBase { 17 18 private StringPair[] testData ; 19 private Class componentType ; 20 21 public PrefixParserData( String propertyName, 22 Operation operation, String fieldName, Object defaultValue, 23 Object testValue, StringPair[] testData, Class componentType ) 24 { 25 super( propertyName, operation, fieldName, defaultValue, testValue ) ; 26 this.testData = testData ; 27 this.componentType = componentType ; 28 } 29 30 public void addToParser( PropertyParser parser ) 31 { 32 parser.addPrefix( getPropertyName(), getOperation(), getFieldName(), 33 componentType ) ; 34 } 35 36 public void addToProperties( Properties props ) 37 { 38 for (int ctr=0; ctr<testData.length; ctr++) { 39 StringPair sp = testData[ctr] ; 40 41 String propName = getPropertyName() ; 42 if (propName.charAt( propName.length() - 1 ) != '.') 43 propName += "." ; 44 45 props.setProperty( propName + sp.getFirst(), sp.getSecond() ) ; 46 } 47 } 48 } 49 | Popular Tags |