summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/utils/CastorXMLUtility.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/c2kernel/utils/CastorXMLUtility.java')
-rw-r--r--src/main/java/com/c2kernel/utils/CastorXMLUtility.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/com/c2kernel/utils/CastorXMLUtility.java b/src/main/java/com/c2kernel/utils/CastorXMLUtility.java
index 4dca391..6bdc657 100644
--- a/src/main/java/com/c2kernel/utils/CastorXMLUtility.java
+++ b/src/main/java/com/c2kernel/utils/CastorXMLUtility.java
@@ -27,16 +27,16 @@ import com.c2kernel.persistency.outcome.Outcome;
**************************************************************************/
public class CastorXMLUtility
{
- private static Mapping mMapping = new Mapping();
- private static HashSet<URL> mMappingKeys = new HashSet<URL>();
-
+ private final Mapping mMapping = new Mapping();
+ private final HashSet<URL> mMappingKeys = new HashSet<URL>();
+
/**
* Looks for a file called 'index.xml' at the given URL, and loads every file
* listed in there by relative path
*
* @param mapURL - map root
- */
- static public void loadMapsFrom(URL mapURL) throws InvalidDataException {
+ */
+ public CastorXMLUtility(URL mapURL) throws InvalidDataException {
// load index.xml
Logger.msg(3, "Loading maps from "+mapURL);
String index;
@@ -60,12 +60,13 @@ public class CastorXMLUtility
Logger.msg("Loaded all maps from "+mapURL.toString());
}
+
/**************************************************************************
* Updates a mapping referenced by the mapID.
* The same mapping cannot be loaded many times as it generates an exception.
* That is the reason for this method as it maintains the HashSet of MappingKeys.
**************************************************************************/
- static public void addMapping( URL mapID )
+ public void addMapping( URL mapID )
throws IOException,
MappingException,
MarshalException,
@@ -89,7 +90,7 @@ public class CastorXMLUtility
* Marshalls a mapped object to string. The mapping must be loaded before.
* See updateMapping().
**************************************************************************/
- static public String marshall( Object obj )
+ public String marshall( Object obj )
throws IOException,
MappingException,
MarshalException,
@@ -112,7 +113,7 @@ public class CastorXMLUtility
* Unmarshalls a mapped object from string. The mapping must be loaded before.
* See updateMapping().
**************************************************************************/
- static public Object unmarshall( String data )
+ public Object unmarshall( String data )
throws IOException,
MappingException,
MarshalException,