fr.ifremer.isisfish.mexico
Class MexicoHelper

java.lang.Object
  extended by fr.ifremer.isisfish.mexico.MexicoHelper

public class MexicoHelper
extends Object

Mexico helper class.

Since:
3.2.0.4 Last update : $Date: 2010-11-29 19:14:09 +0100 (lun., 29 nov. 2010) $ By : $Author: chatellier $
Version:
$Revision: 3124 $
Author:
chatellier

Constructor Summary
MexicoHelper()
           
 
Method Summary
protected static StringBuffer appendString(StringBuffer buffer, Object o)
          Append object type and value in stringbuffer.
static String formatXML(String unformattedXml)
          Deprecated. use standard java xml api instead of xerces
static String getDesignPlanAsXML(DesignPlan designPlan)
          Get xml representation of a design plan.
static DesignPlan getDesignPlanFromXML(File xmlFile, org.nuiton.topia.TopiaContext topiaContext)
          Parse xmlFile with sax, and return a DesignPlan.
static String getMatrixAsXML(org.nuiton.math.matrix.MatrixND matrix)
          Transform matrix into XML mexico format.
static org.nuiton.math.matrix.MatrixND getMatrixFromXml(org.dom4j.Element mxElement, org.nuiton.topia.TopiaContext context)
          Parse a dom element (mx) as a MatrixND.
protected static String getQualifiedName(Object o)
          Return object fully qualified name excepted for TopiaEntity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MexicoHelper

public MexicoHelper()
Method Detail

getDesignPlanAsXML

public static String getDesignPlanAsXML(DesignPlan designPlan)
Get xml representation of a design plan.

Parameters:
designPlan - design plan
Returns:
xml design plan representation

getDesignPlanFromXML

public static DesignPlan getDesignPlanFromXML(File xmlFile,
                                              org.nuiton.topia.TopiaContext topiaContext)
                                       throws IOException
Parse xmlFile with sax, and return a DesignPlan.

Parameters:
xmlFile - file path to parse
topiaContext - database context
Returns:
DesignPlan
Throws:
IOException

formatXML

@Deprecated
public static String formatXML(String unformattedXml)
Deprecated. use standard java xml api instead of xerces

Format xml string.

Parameters:
unformattedXml - non formatted xml string (must be valid xml)
Returns:
xml, formatted and indented
Throws:
IsisFishRuntimeException
IllegalArgumentException - if input xml is not valid

getMatrixAsXML

public static String getMatrixAsXML(org.nuiton.math.matrix.MatrixND matrix)
Transform matrix into XML mexico format. Format is :
   
    
      
      
    
    
      
      
      
    
    2.0
    3.1415
    2.0
    3.1415
    2.0
    3.1415
  
 

Parameters:
matrix - matrix
Returns:
matrix as xml or null if matrix is null
Since:
3.3.0.0

appendString

protected static StringBuffer appendString(StringBuffer buffer,
                                           Object o)
Append object type and value in stringbuffer. Append it as :
fqn(value)

Parameters:
buffer - buffer to append to
o - value to append
Returns:
stringbuffer

getMatrixFromXml

public static org.nuiton.math.matrix.MatrixND getMatrixFromXml(org.dom4j.Element mxElement,
                                                               org.nuiton.topia.TopiaContext context)
Parse a dom element (mx) as a MatrixND. Format is :
   
    
      
      
    
    
      
      
      
    
    2.0
    3.1415
    2.0
    3.1415
    2.0
    3.1415
  
 

Parameters:
mxElement - dom element
context - topia context
Returns:
matrix nd

getQualifiedName

protected static String getQualifiedName(Object o)
Return object fully qualified name excepted for TopiaEntity.

Parameters:
o - object to get fqn
Returns:
fqn for mexico file format


Copyright © 1999-2011 CodeLutin. All Rights Reserved.