gov.nih.nci.cagrid.data.common
Class CastorMappingUtil

java.lang.Object
  extended by gov.nih.nci.cagrid.data.common.CastorMappingUtil

public class CastorMappingUtil
extends java.lang.Object

CastorMappingUtil Utility for making edits to a castor mapping xml document

Version:
$Id: CastorMappingUtil.java,v 1.7 2007/12/06 18:37:58 dervin Exp $
Author:
David W. Ervin

Field Summary
static java.lang.String CASTOR_MARSHALLING_MAPPING_FILE
           
static java.lang.String CASTOR_UNMARSHALLING_MAPPING_FILE
           
static java.lang.String EDITED_CASTOR_MARSHALLING_MAPPING_FILE
           
static java.lang.String EDITED_CASTOR_UNMARSHALLING_MAPPING_FILE
           
static java.lang.String XERXES_LOAD_DTD_FEATURE
          Setting this feature controls how xerxes handles external DTDs
 
Constructor Summary
CastorMappingUtil()
           
 
Method Summary
static java.lang.String changeNamespaceOfPackage(java.lang.String mapping, java.lang.String packageName, java.lang.String namespace)
          Edits a castor mapping XML file to change the namespace of all classes in a package
static java.lang.String getCustomCastorMappingFileName(ServiceInformation serviceInfo)
           
static java.lang.String getCustomCastorMappingName(ServiceInformation serviceInfo)
           
static java.lang.String getEditedMarshallingCastorMappingFileName(ServiceInformation serviceInfo)
          Gets the fully qualified file name of the edited marshalling castor mapping file
static java.lang.String getEditedMarshallingCastorMappingName(ServiceInformation serviceInfo)
           
static java.lang.String getEditedUnmarshallingCastorMappingFileName(ServiceInformation serviceInfo)
          Gets the fully qualified file name of the edited unmarshalling castor mapping file
static java.lang.String getEditedUnmarshallingCastorMappingName(ServiceInformation serviceInfo)
           
static java.lang.String getMarshallingCastorMappingFileName(ServiceInformation serviceInfo)
           
static java.lang.String getMarshallingCastorMappingName(ServiceInformation serviceInfo)
           
static java.lang.String getUnmarshallingCastorMappingFileName(ServiceInformation serviceInfo)
           
static java.lang.String getUnmarshallingCastorMappingName(ServiceInformation serviceInfo)
           
static void main(java.lang.String[] args)
           
static java.lang.String removeAssociationMappings(java.lang.String mappingText)
          Walks through a castor mapping text document and removes all bindings to associations, so that serialization only converts the top level object of an object tree to XML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XERXES_LOAD_DTD_FEATURE

public static final java.lang.String XERXES_LOAD_DTD_FEATURE
Setting this feature controls how xerxes handles external DTDs

See Also:
Constant Field Values

CASTOR_MARSHALLING_MAPPING_FILE

public static final java.lang.String CASTOR_MARSHALLING_MAPPING_FILE
See Also:
Constant Field Values

EDITED_CASTOR_MARSHALLING_MAPPING_FILE

public static final java.lang.String EDITED_CASTOR_MARSHALLING_MAPPING_FILE
See Also:
Constant Field Values

CASTOR_UNMARSHALLING_MAPPING_FILE

public static final java.lang.String CASTOR_UNMARSHALLING_MAPPING_FILE
See Also:
Constant Field Values

EDITED_CASTOR_UNMARSHALLING_MAPPING_FILE

public static final java.lang.String EDITED_CASTOR_UNMARSHALLING_MAPPING_FILE
See Also:
Constant Field Values
Constructor Detail

CastorMappingUtil

public CastorMappingUtil()
Method Detail

changeNamespaceOfPackage

public static java.lang.String changeNamespaceOfPackage(java.lang.String mapping,
                                                        java.lang.String packageName,
                                                        java.lang.String namespace)
                                                 throws java.lang.Exception
Edits a castor mapping XML file to change the namespace of all classes in a package

Parameters:
mapping - The text of the castor mapping file
packageName - The name of the package to change the namespace mapping of
namespace - The namespace to remap the package's classes to
Returns:
The modified text of the castor mapping file
Throws:
java.lang.Exception

removeAssociationMappings

public static java.lang.String removeAssociationMappings(java.lang.String mappingText)
                                                  throws java.lang.Exception
Walks through a castor mapping text document and removes all bindings to associations, so that serialization only converts the top level object of an object tree to XML

Parameters:
mappingText - The text of the original castor mapping
Returns:
The edited text of the castor mapping
Throws:
java.lang.Exception

getCustomCastorMappingFileName

public static java.lang.String getCustomCastorMappingFileName(ServiceInformation serviceInfo)

getCustomCastorMappingName

public static java.lang.String getCustomCastorMappingName(ServiceInformation serviceInfo)

getMarshallingCastorMappingFileName

public static java.lang.String getMarshallingCastorMappingFileName(ServiceInformation serviceInfo)

getMarshallingCastorMappingName

public static java.lang.String getMarshallingCastorMappingName(ServiceInformation serviceInfo)

getUnmarshallingCastorMappingFileName

public static java.lang.String getUnmarshallingCastorMappingFileName(ServiceInformation serviceInfo)

getUnmarshallingCastorMappingName

public static java.lang.String getUnmarshallingCastorMappingName(ServiceInformation serviceInfo)

getEditedMarshallingCastorMappingFileName

public static java.lang.String getEditedMarshallingCastorMappingFileName(ServiceInformation serviceInfo)
Gets the fully qualified file name of the edited marshalling castor mapping file

Parameters:
serviceInfo -
Returns:
The fully qualified file name

getEditedMarshallingCastorMappingName

public static java.lang.String getEditedMarshallingCastorMappingName(ServiceInformation serviceInfo)

getEditedUnmarshallingCastorMappingFileName

public static java.lang.String getEditedUnmarshallingCastorMappingFileName(ServiceInformation serviceInfo)
Gets the fully qualified file name of the edited unmarshalling castor mapping file

Parameters:
serviceInfo -
Returns:
The fully qualified file name

getEditedUnmarshallingCastorMappingName

public static java.lang.String getEditedUnmarshallingCastorMappingName(ServiceInformation serviceInfo)

main

public static void main(java.lang.String[] args)