You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Fotis Jannidis <fo...@lrz.uni-muenchen.de> on 2000/11/27 17:49:00 UTC

configuration

Here is a proposal for some configuration capabilities in Fop. It is 
simple and uses a lot of static classes. As soon as Avalon is usable 
we can switch. 

What do you think?

Fotis


org.apache.fop.config

public interface Configuration
  public void setConfiguration(Hashtable config)
  public Object getValue (String key) 
  //convenience methods
  public String getStringValue(String key)
  public Vector getListValue(String key)
  public Hashtable getHashtableValue(String key)

//for all information which is not renderer specific
public class StandardConfiguration implements Configuration
    implements interface with static methods

public class PDFConfiguration implements Configuration

public class AWTConfiguration implements Configuration


//reads default config info from a xml file 
//in org.apache.fop.config
//user extensions can be added with another file
//which overwrites the default values

public class ConfigurationReader
  public ConfigurationReader (String filename) 
  public void start ()

//probably not really needed now, 
public class ConfigurationWriter 


<!-- template for configuration file -->
<!-- 

3 entry types are supported: 

1) simple key:value pairs 
2) key:lists 
3) key:subkey-value,subkey-value.. (Hashtables) -->

<configuration>
  <!-- 1) simple key:value pairs -->
  <entry>
    <datatype>
      string
    </datatype>
    <key>
      keyString
    </key>
    <value>
      valueString
    </value>
  </entry>
  
  <!-- 2) key:lists -->
  <entry>
    <datatype>
      list
    </datatype>
    <key>
      keyString
    </key>
    <values>
      <value>
        valueString1
      </value>
      <value>
        valueString2
      </value>
      [...]
    </values>
  </entry>

  <!-- 3) key:subkey-value,subkey-value.. (Hashtables) -->
  <entry>
    <datatype>
      hashtable
    </datatype>
    <key>
      keyString
    </key>
    <values>
      <subkey>
        keyString 1
      </subkey>
      <value>
        value
      </value>
      [...]
    </values>
  </entry>

</configuration>