Package nexj.core.util

Examples of nexj.core.util.HashTab


      if (nCount != 0)
      {
         if (m_offsetMap == null)
         {
            m_offsetMap = new HashTab();
         }

         int nDirectCount = 0;

         for (int i = 0; i < nCount; ++i)
View Full Code Here


         addAccessor(m_keysAccessor);
         addAccessor(m_valuesAccessor);

         // use a temporary pointer in the event that an exception causes an early exit from
         // function, the actual m_attributeMap isn't left half initialized (yes it happend)
         Lookup attributeMap = new HashTab/*<Attribute, ObjectAccessor>*/();

         if (m_metaclass != null)
         {
            for (Iterator/*<Attribute>*/ itr = m_metaclass.getAttributeIterator(); itr.hasNext();)
            {
               Attribute attribute = (Attribute)itr.next();
  
               if (attribute.getVisibility() != Metaclass.PUBLIC)
               {
                  continue; // ignore non-publicly visible attributes
               }

               String sTmpName = XSDGenerator.computeElementName(attribute);
               QName qType = getQualifiedType(attribute.getType());
               Unmarshaller unmarshaller =
                  unmsh.getUnmarshaller(qType.getNamespaceURI(), qType.getLocalPart(), null);

               if (unmarshaller != null)
               {
                  QName type = XML.getTNSType(sTmpName);
                  ObjectInstanceAccessor accessor = (attribute.isCollection())
                     ? new ObjectListAccessor(type, false, true, unmarshaller, false)
                     : new ObjectInstanceAccessor(type, false, true, unmarshaller, false);

                  addAccessor(accessor);
                  attributeMap.put(attribute, accessor);
               }
            }
         }

         m_attributeMap = attributeMap;
View Full Code Here

         m_requiredXMLMetatypeMap.remove(((XMLMetatype)s_xmlMetatypeList.get(i)).getType());
      }

      m_requiredXMLMetatypeMap.remove(m_arrayDeclarator.getType()); // no need for MS.NET kludge
      setRequiredType(DEFAULT_BASE_METATYPE); // redefined to not use inheritance for MDS compliance
      m_deepRecursiveMetaclassMap = new HashTab/*<String, Boolean>*/();
      m_inProgressClassNameSet = new HashHolder/*<String>*/();
      m_metaclassAttributeCacheMap = new HashTab/*<String, List<Attribute>>*/();
   }
View Full Code Here

   public List exportData(Set dataSourceSet, Lookup whereMap, boolean bExclusive)
   {
      Metadata metadata = m_context.getMetadata();
      List resultList = new ArrayList();
      Lookup identityMap = new IdentityHashTab();
      Lookup classMap = new HashTab();

      for (Iterator itr = metadata.getMetaclassIterator(); itr.hasNext();)
      {
         Metaclass metaclass = (Metaclass)itr.next();
         PersistenceMapping mapping = metaclass.getPersistenceMapping();
         Object where = resolve(metaclass, whereMap);

         if (mapping == null ||
            dataSourceSet != null && !dataSourceSet.contains(mapping.getDataSource()) ||
            where == null && bExclusive ||
            Boolean.FALSE.equals(where) ||
            !isWritable(mapping))
         {
            continue;
         }

         Metaclass root = metaclass.getPersistenceRoot();
         Pair attributes = null;

         for (int i = 0, n = metaclass.getInstanceAttributeCount(); i < n; ++i)
         {
            Attribute attribute = metaclass.getInstanceAttribute(i);
            Metaclass declarator = attribute.getDeclarator();

            if (attribute.isPersistent() &&
               attribute.getWhere() == null &&
               (!attribute.isCollection() || attribute.getReverse() == null) &&
               attribute != mapping.getLockingAttribute() &&
               (declarator == metaclass ||
                  declarator.getPersistenceMapping() == null ||
                  declarator.getPersistenceMapping().isCompatible(metaclass.getPersistenceMapping())) &&
               isWritable(metaclass.getPersistenceMapping().getAttributeMapping(attribute)))
            {
               attributes = new Pair(attribute.getSymbol(), attributes);
            }
         }

         if (metaclass != root)
         {
            attributes = new Pair(new Pair(Symbol.ATAT, new Pair(metaclass.getSymbol(), attributes)));
         }

         classMap.put(root, Pair.append((Pair)classMap.get(root), attributes));
      }

      for (Iterator itr = classMap.iterator(); itr.hasNext();)
      {
         Metaclass metaclass = (Metaclass)itr.next();

         if (s_logger.isDebugEnabled())
         {
            s_logger.debug("Reading class \"" + metaclass.getName() + "\"");
         }

         Pair attributes = (Pair)classMap.get(metaclass);

         resultList.add(new Pair(read(metaclass, attributes, resolve(metaclass, whereMap)), attributes));
      }

      List list = new ArrayList();
View Full Code Here

         RPCUtil.transfer(read(metaclass, attributes, where), attributes,
            identityMap, RPCUtil.TF_ALL | RPCUtil.TF_LAZY);
      }

      Lookup whereMap = new HashTab();

      for (Iterator itr = identityMap.iterator(); itr.hasNext();)
      {
         Object obj = itr.next();

         if (obj instanceof Instance)
         {
            Instance instance = (Instance)obj;
            OID oid = instance.getOID();

            if (oid != null)
            {
               Metaclass metaclass = instance.getLazyMetaclass().getPersistenceRoot();
               Set oidSet = (Set)whereMap.get(metaclass);

               if (oidSet == null)
               {
                  oidSet = new HashHolder();
                  whereMap.put(metaclass, oidSet);
               }

               oidSet.add(oid);
            }
         }
View Full Code Here

      Lookup map = (Lookup)m_stringMap.get(sLocale);

      if (map == null)
      {
         map = new HashTab();
         m_stringMap.put(sLocale, map);
      }

      Object oldPath = map.put(sPath, sPath);
View Full Code Here

      m_bEmpty = false;
      m_bIgnoreRoot = false;
      m_metaRefMap = new HashTab2D/*<String, OID, Integer>*/();
      m_fixupArray = new Object[48];
      m_indexArray = new int[48];
      m_arrayUnmshMap = new HashTab();
      m_idMap = new HashTab(); // object to map an xml:id -> id in m_fixupArray
      m_nsMap = new HashTab();
      m_stack = new Object[48];
      m_valueBuf = new StringBuffer(32);
      m_metaclassStaticUnmarshaller = (metaclass == null) ? null :
         new MetaclassUnmarshaller(XML.NS_URI_TNS, metaclass.getName(), metaclass);       

View Full Code Here

    * Create a lookup of the current marker values.
    * @return A map containing the current marker values;
    */
   public Lookup saveMarkerState()
   {
      Lookup markerLookup = new HashTab(m_markerList.size() / 2);

      for (int i = 0; i < m_markerList.size(); i += 2)
      {
         markerLookup.put(m_markerList.get(i), m_markerList.get(i + 1));
      }

      return markerLookup;
   }
View Full Code Here

      int nCookie = pushMarker(MetadataValidationException.TYPE_NAME, "Metadata");

      try
      {
         final Element[] elementArray = new Element[1];
         Lookup resourceMap = new HashTab(1);

         m_listing = new XMLMetadataListing();

         if (bRoot)
         {
            setSearchMode(SEARCH_ROOT_ONLY);
            resourceMap.put(m_sMetadataFileName,
               new XMLResource(m_sMetadataFileName,  new URL(m_rootURL, m_sMetadataFileName), true));
            m_listing.setRootResourceMap(resourceMap);
         }
         else
         {
            setSearchMode(SEARCH_BASE_ONLY);
            resourceMap.put(m_sMetadataFileName,
               new XMLResource(m_sMetadataFileName, new URL(m_baseURL, m_sMetadataFileName), false));
            m_listing.setBaseResourceMap(resourceMap);
         }

         m_listing.setResourceMap(resourceMap);
View Full Code Here

   /**
    * @see XMLMetadataHelper#getListing(MixinHandler, Lookup)
    */
   public XMLMetadataListing getListing(MixinHandler handler)
   {
      return getListing(handler, new HashTab());
   }
View Full Code Here

TOP

Related Classes of nexj.core.util.HashTab

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.