You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by aj...@apache.org on 2006/07/04 07:55:21 UTC

svn commit: r418919 - /webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaObject.java

Author: ajith
Date: Mon Jul  3 22:55:21 2006
New Revision: 418919

URL: http://svn.apache.org/viewvc?rev=418919&view=rev
Log:
1. Adding a meta data hanger as suggested in the mailing list

Modified:
    webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaObject.java

Modified: webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaObject.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaObject.java?rev=418919&r1=418918&r2=418919&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaObject.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaObject.java Mon Jul  3 22:55:21 2006
@@ -16,12 +16,47 @@
 
 package org.apache.ws.commons.schema;
 
+import java.util.Map;
+import java.util.LinkedHashMap;
+
 public abstract class XmlSchemaObject {
     int lineNumber;
     int linePosition;
     String sourceURI;
 
     /**
+     * a map for holding meta information
+     * Initially set to null to gain some improvement
+     * in memory. will be initialized only if a
+     * user attempts
+     */
+    private Map metaInfoMap = null;
+
+    /**
+     * returns the metainfo map. may be null
+     * if not utilized
+     */
+    public Map getMetaInfoMap() {
+        return metaInfoMap;
+    }
+
+    /**
+     * Add a value to the meta info map
+     * will be initialized if not used
+     * previously
+     * @param key
+     * @param value
+     */
+    public void addMetaInfo(Object key,Object value){
+      if (metaInfoMap==null){
+          metaInfoMap =  new LinkedHashMap();
+      }
+
+      metaInfoMap.put(key,value);
+    }
+
+
+    /**
      * Creates new XmlSchemaObject
      */
     protected XmlSchemaObject() {
@@ -55,22 +90,22 @@
         if (what == this) {
             return true;
         }
-        
+
         // note: instanceof returns false if its first operand is null 
         if (!(what instanceof XmlSchemaObject)) {
             return false;
         }
-        
+
         XmlSchemaObject xso = (XmlSchemaObject) what;
-        
+
         if (this.lineNumber != xso.lineNumber) {
             return false;
         }
-        
+
         if (this.linePosition != xso.linePosition) {
             return false;
         }
-        
+
         if (this.sourceURI != null) {
             if (!this.sourceURI.equals(xso.sourceURI)) {
                 return false;
@@ -80,7 +115,7 @@
                 return false;
             }
         }
-        
+
         return true;
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org