ruper2/src/java/core/org/krysalis/ruper2/util/xml XMLParser.java,1.2,1.3 XMLHandler.java,1.4,1.5

[email protected]
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/util/xml
In directory sc8-pr-cvs1:/tmp/cvs-serv8045/src/java/core/org/krysalis/ruper2/util/xml

Modified Files:
	XMLParser.java XMLHandler.java 
Log Message:
Share a good idea w/ k-v...

Index: XMLParser.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/util/xml/XMLParser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** XMLParser.java	14 Oct 2003 20:48:07 -0000	1.2
--- XMLParser.java	22 Oct 2003 02:14:09 -0000	1.3
***************
*** 14,17 ****
--- 14,18 ----
  
  import org.krysalis.ruper2.util.io.FileUtils;
+ import org.krysalis.version.util.envsafe.ClassLoaderContext;
  import org.xml.sax.InputSource;
  import org.xml.sax.XMLReader;
***************
*** 22,32 ****
  public class XMLParser {
  	private XMLEntryTable m_xmlEntryTable;
  
  	/**
  	 * 
  	 */
! 	public XMLParser(XMLEntryTable xmlEntryTable) {
! 		super();
  		m_xmlEntryTable = xmlEntryTable;
  	}
  
--- 23,37 ----
  public class XMLParser {
  	private XMLEntryTable m_xmlEntryTable;
+ 	private ClassLoaderContext m_classLoaderHelper;
  
  	/**
  	 * 
  	 */
! 	public XMLParser(
! 		XMLEntryTable xmlEntryTable,
! 		ClassLoaderContext loaderHelper) {
! 
  		m_xmlEntryTable = xmlEntryTable;
+ 		m_classLoaderHelper = loaderHelper;
  	}
  
***************
*** 34,38 ****
  		XMLContext xmlContext = new XMLContext();
  
! 		return parse(source, new XMLHandler(xmlContext, this.m_xmlEntryTable));
  	}
  	/**
--- 39,45 ----
  		XMLContext xmlContext = new XMLContext();
  
! 		return parse(
! 			source,
! 			new XMLHandler(xmlContext, m_xmlEntryTable, m_classLoaderHelper));
  	}
  	/**
***************
*** 44,48 ****
  	public XMLContext parse(Object source) throws XMLException {
  		XMLContext xmlContext = new XMLContext();
! 		return parse(source, new XMLHandler(xmlContext, this.m_xmlEntryTable));
  	}
  
--- 51,57 ----
  	public XMLContext parse(Object source) throws XMLException {
  		XMLContext xmlContext = new XMLContext();
! 		return parse(
! 			source,
! 			new XMLHandler(xmlContext, m_xmlEntryTable, m_classLoaderHelper));
  	}
  

Index: XMLHandler.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/util/xml/XMLHandler.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** XMLHandler.java	20 Oct 2003 22:06:45 -0000	1.4
--- XMLHandler.java	22 Oct 2003 02:14:09 -0000	1.5
***************
*** 8,13 ****
  
  import org.krysalis.ruper2.impl.ReferenceManager;
! import org.krysalis.ruper2.log.Logger;
! import org.krysalis.version.util.envsafe.RelativelySafe;
  import org.xml.sax.Attributes;
  import org.xml.sax.Locator;
--- 8,13 ----
  
  import org.krysalis.ruper2.impl.ReferenceManager;
! import org.krysalis.version.log.Logger;
! import org.krysalis.version.util.envsafe.ClassLoaderContext;
  import org.xml.sax.Attributes;
  import org.xml.sax.Locator;
***************
*** 23,26 ****
--- 23,27 ----
  	private Stack m_tagObjectStack = new Stack();
  	private Object m_currentTagObject;
+ 	private ClassLoaderContext m_classLoaderHelper = null;
  
  	private XMLContext m_context;
***************
*** 32,38 ****
  	}
  
! 	public XMLHandler(XMLContext context, XMLEntryTable xmlEntryTable) {
  		m_context = context;
  		m_xmlEntryTable = xmlEntryTable;
  	}
  
--- 33,40 ----
  	}
  
! 	public XMLHandler(XMLContext context, XMLEntryTable xmlEntryTable, ClassLoaderContext loaderHelper) {
  		m_context = context;
  		m_xmlEntryTable = xmlEntryTable;
+ 		m_classLoaderHelper = loaderHelper;
  	}
  
***************
*** 71,75 ****
  						Object currentTagObject = null;
  						Class clazz =
! 							RelativelySafe.getClassForName(clazzName);
  
  						String tagId =
--- 73,77 ----
  						Object currentTagObject = null;
  						Class clazz =
! 							m_classLoaderHelper.getClassForName(clazzName);
  
  						String tagId =
***************
*** 135,139 ****
  		}
  		catch (Exception exception) {
! 			Logger.getLog().error("XML_BEAN_ERROR", exception);
  			throw new SAXParseException(
  				exception.getLocalizedMessage(),
--- 137,141 ----
  		}
  		catch (Exception exception) {
! 			Logger.getLogger().error("XML_BEAN_ERROR", exception);
  			throw new SAXParseException(
  				exception.getLocalizedMessage(),
***************
*** 186,190 ****
  
  				// log it 
! 				Logger.getLog().debug(
  					"Child :"
  						+ childClass.getName()
--- 188,192 ----
  
  				// log it 
! 				Logger.getLogger().debug(
  					"Child :"
  						+ childClass.getName()
***************
*** 243,247 ****
  					}
  					// log it 
! 					Logger.getLog().debug(
  						"Attribute :" + attributeName + " is set");
  					attributeSet = true;
--- 245,249 ----
  					}
  					// log it 
! 					Logger.getLogger().debug(
  						"Attribute :" + attributeName + " is set");
  					attributeSet = true;
***************
*** 284,288 ****
  					// if there is a class name, load a class
  					Class attributeClass =
! 					RelativelySafe.getClassForName(attributeClassName);
  
  					objectAttributeValue =
--- 286,290 ----
  					// if there is a class name, load a class
  					Class attributeClass =
! 					m_classLoaderHelper.getClassForName(attributeClassName);
  
  					objectAttributeValue =
***************
*** 314,318 ****
  
  				if (!attributeSet) {
! 					Logger.getLog().error(
  						"Attribute :"
  							+ attributeName
--- 316,320 ----
  
  				if (!attributeSet) {
! 					Logger.getLogger().error(
  						"Attribute :"
  							+ attributeName
***************
*** 372,376 ****
  		}
  		catch (Exception exception) {
! 			Logger.getLog().error("XML_BEAN_ERROR", exception);
  			throw new SAXParseException(
  				exception.getLocalizedMessage(),
--- 374,378 ----
  		}
  		catch (Exception exception) {
! 			Logger.getLogger().error("XML_BEAN_ERROR", exception);
  			throw new SAXParseException(
  				exception.getLocalizedMessage(),




-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.