chemaxon.marvin.io
Class MPropHandler

java.lang.Object
  extended by chemaxon.marvin.io.MPropHandler

public final class MPropHandler
extends java.lang.Object

Property factory.

Since:
Marvin 4.1, 11/20/2005
Version:
4.1.3, 11/09/2006
Author:
Peter Csizmadia

Constructor Summary
MPropHandler()
           
 
Method Summary
static java.lang.String convertToString(MPropertyContainer p, java.lang.String key)
          Convert key of MPropertyContainer to string.
static java.lang.String convertToString(MProp p, java.lang.String fmt)
          Converts the property to text format.
static MProp createArray(java.lang.String type, java.lang.String sval, int arrsize, int delim)
          Creates an array property.
static MProp createArrayXSD(java.lang.String xsdtype, java.lang.String sval, int size, int delim)
          Creates an array property from the XSD type.
static MMoleculeProp createMMoleculeProp(java.lang.String sval)
           
static MProp createScalar(java.lang.String type, java.lang.String sval)
          Creates a scalar property.
static MProp createScalar(java.lang.String type, java.lang.String sval, chemaxon.common.util.MProgressMonitor pmon)
          Creates a scalar property.
static MProp createScalarXSD(java.lang.String xsdtype, java.lang.String sval)
          Creates a scalar property from the XSD type.
static Molecule parseMolecule(java.lang.String sval)
           
static MProp stringToArray(java.lang.String xsdtype, java.lang.String sval, int size, int delim)
           
static MProp stringToScalar(java.lang.String xsdtype, java.lang.String sval)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MPropHandler

public MPropHandler()
Method Detail

createScalar

public static MProp createScalar(java.lang.String type,
                                 java.lang.String sval)
                          throws MolFormatException
Creates a scalar property.

Parameters:
type - property type or class name
sval - string value to parse
Throws:
MolFormatException

createScalar

public static MProp createScalar(java.lang.String type,
                                 java.lang.String sval,
                                 chemaxon.common.util.MProgressMonitor pmon)
                          throws MolFormatException
Creates a scalar property.

Parameters:
type - property type or class name
sval - string value to parse
pmon - progress monitor
Throws:
MolFormatException
Since:
Marvin 5.0

createArray

public static MProp createArray(java.lang.String type,
                                java.lang.String sval,
                                int arrsize,
                                int delim)
                         throws MolFormatException,
                                java.lang.IllegalArgumentException
Creates an array property.

Parameters:
type - property type or class name
sval - string value to parse
Throws:
java.lang.IllegalArgumentException
MolFormatException

createScalarXSD

public static MProp createScalarXSD(java.lang.String xsdtype,
                                    java.lang.String sval)
                             throws MolFormatException
Creates a scalar property from the XSD type.

Parameters:
xsdtype - the XSD type
sval - string value to parse
Throws:
MolFormatException

createArrayXSD

public static MProp createArrayXSD(java.lang.String xsdtype,
                                   java.lang.String sval,
                                   int size,
                                   int delim)
                            throws MolFormatException
Creates an array property from the XSD type.

Parameters:
xsdtype - the XSD type
sval - string value to parse
Throws:
MolFormatException

convertToString

public static java.lang.String convertToString(MProp p,
                                               java.lang.String fmt)
                                        throws java.lang.IllegalArgumentException
Converts the property to text format.

Parameters:
p - property
fmt - the molecule file format or null
Returns:
the string
Throws:
java.lang.IllegalArgumentException - if conversion fails

convertToString

public static java.lang.String convertToString(MPropertyContainer p,
                                               java.lang.String key)
Convert key of MPropertyContainer to string.

Parameters:
p - container
key - property object
Returns:
the value of the property, or null if the key is not found

stringToScalar

public static MProp stringToScalar(java.lang.String xsdtype,
                                   java.lang.String sval)
                            throws java.io.IOException
Throws:
java.io.IOException

stringToArray

public static MProp stringToArray(java.lang.String xsdtype,
                                  java.lang.String sval,
                                  int size,
                                  int delim)
                           throws java.io.IOException
Throws:
java.io.IOException

parseMolecule

public static Molecule parseMolecule(java.lang.String sval)
                              throws java.io.IOException
Throws:
java.io.IOException

createMMoleculeProp

public static MMoleculeProp createMMoleculeProp(java.lang.String sval)
                                         throws java.io.IOException
Throws:
java.io.IOException