Class EDEFProperties

    • Constructor Detail

      • EDEFProperties

        public EDEFProperties()
        Create empty EDEFProperties instance.
      • EDEFProperties

        public EDEFProperties​(Map<String,​Object> properties)
        Create EDEFProperties instance initialized with all the given properties
        Parameters:
        properties - must not be null
    • Method Detail

      • getValue

        public EDEFProperties.Value getValue​(String name)
        Get EDEF Property Value given name
        Parameters:
        name - the name/key of the EDEFProperty previously loaded or added. Must not be null.
        Returns:
        Value the value found for given name/key. Null if not found.
      • putEDEFProperty

        public Object putEDEFProperty​(String name,
                                      Object value)
        Put String->Object relation in as an EDEF property. Both the key and value must not be null. The value must be either a Set, List, Array type or a primitive type: Long/long, Byte/byte, Short/short, Int/Integer, char/Character, double/Double, float/Float. If array,set, or list, the elements must be one of the primitive types.
        Parameters:
        key - unique name/key for given value. Must not be null.
        value - array,list,set of primitive type or instance of primitive type.
        Returns:
        existing Object with name/key. Null if no existing object exists.
      • getEDEFPropertiesAsMap

        public Map<String,​Object> getEDEFPropertiesAsMap()
        Get EDEF properties as String -> Object map
        Returns:
        Map containing all name->EDEFPropertiesValue contents of this EDEFProperties
      • loadEDEFProperties

        public void loadEDEFProperties​(InputStream ins)
                                throws IOException
        Load EDEF properties from the given input stream
        Parameters:
        ins - InputStream to read the edef properties from. Must not be null
        Throws:
        IOException - if properties cannot be read from given InputStream
      • loadEDEFProperties

        public void loadEDEFProperties​(Reader reader)
                                throws IOException
        Load EDEF properties from the given reader
        Parameters:
        reader - Reader to read the edef properties from. Must not be null
        Throws:
        IOException - if properties cannot be read from given Reader
      • storeEDEFProperties

        public void storeEDEFProperties​(Writer writer,
                                        String comments)
                                 throws IOException
        Store EDEF properties to given Writer
        Parameters:
        writer - the Writer to write output to. Must not be null.
        comments -
        Throws:
        IOException
      • storeEDEFProperties

        public void storeEDEFProperties​(BufferedWriter bufferedWriter,
                                        String comments)
                                 throws IOException
        Store EDEF properties to the given buffered writer.
        Parameters:
        bufferedWriter - the BufferedWriter to write to. Must not be null
        comments - Comment line prepended to properties file output. May be null.
        Throws:
        IOException - if properties cannot be written to bufferedWriter
      • putEDEFProperties

        public void putEDEFProperties​(Map<String,​Object> properties)
        Put all the given properties into this map as EDEF properties, suitable for storing via storeEDEFProperties(Writer, String)
        Parameters:
        properties - the properties to put. May not be null