org.fudgemsg.taxon
Class PropertyFileTaxonomy

java.lang.Object
  extended by org.fudgemsg.taxon.MapFudgeTaxonomy
      extended by org.fudgemsg.taxon.PropertyFileTaxonomy
All Implemented Interfaces:
FudgeTaxonomy

public class PropertyFileTaxonomy
extends MapFudgeTaxonomy

An immutable taxonomy implementation based a properties file.


Field Summary
 
Fields inherited from class org.fudgemsg.taxon.MapFudgeTaxonomy
EMPTY
 
Constructor Summary
PropertyFileTaxonomy(Properties properties)
          Creates a taxonomy from a Properties instance.
PropertyFileTaxonomy(ResourceBundle resourceBundle)
          Creates a taxonomy from a ResourceBundle.
PropertyFileTaxonomy(URL url)
          Creates a taxonomy from an XML document at a URL.
 
Method Summary
 
Methods inherited from class org.fudgemsg.taxon.MapFudgeTaxonomy
fromFudgeMsg, getFieldName, getFieldOrdinal, toFudgeMsg
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyFileTaxonomy

public PropertyFileTaxonomy(ResourceBundle resourceBundle)
Creates a taxonomy from a ResourceBundle.

For example:

 MyTaxonomy.properties
 
 1 = id
 2 = name
 3 = email
 4 = telephone
 
Could be loaded using:
 new PropertyFileTaxonomy(ResourceBundle.getBundle("MyTaxonomy")) 
 

Parameters:
resourceBundle - the taxonomy representation to load, not null

PropertyFileTaxonomy

public PropertyFileTaxonomy(Properties properties)
Creates a taxonomy from a Properties instance.

The keys are the ordinals and the values are the field names.

Parameters:
properties - the taxonomy representation

PropertyFileTaxonomy

public PropertyFileTaxonomy(URL url)
Creates a taxonomy from an XML document at a URL.

The URL must point to an XML document that can be loaded with Properties.loadFromXML(java.io.InputStream).

Parameters:
url - URL pointing toward an XML document that describes the taxonomy


Copyright 2009-Present by OpenGamma Inc. and individual contributors
Released under the Apache License, Version 2.0