Package org.jboss.metadata.spi.scope

Examples of org.jboss.metadata.spi.scope.ScopeLevel


   }

   public void testScopeLevelMapBehaviourDuplicates() throws Exception
   {
      HashMap<ScopeLevel, Object> map = new HashMap<ScopeLevel, Object>();
      ScopeLevel test1 = new ScopeLevel(1, "HELLO");
      map.put(test1, new Object());
      checkMap(map);
      ScopeLevel test2 = new ScopeLevel(1, "HELLO");
      map.put(test2, new Object());
      checkMap(map);
      ScopeLevel test3 = new ScopeLevel(1, "DIFFERENT");
      map.put(test3, new Object());
      checkMap(map);
   }
View Full Code Here


   }
  
   protected void checkMap(HashMap<ScopeLevel, Object> map) throws Exception
   {
      assertEquals(1, map.size());
      ScopeLevel test = map.keySet().iterator().next();
      assertEquals(1, test.getLevel());
      assertEquals("HELLO", test.getName());
   }
View Full Code Here

   }

   public void testScopeLevelMap() throws Exception
   {
      LinkedHashMap<ScopeLevel, Object> map = new LinkedHashMap<ScopeLevel, Object>();
      ScopeLevel test1 = new ScopeLevel(1, "HELLO");
      Object object1 = new Object();
      map.put(test1, object1);
      ScopeLevel test2 = new ScopeLevel(2, "HELLO");
      Object object2 = new Object();
      map.put(test2, object2);
      ScopeLevel test3 = new ScopeLevel(3, "DIFFERENT");
      Object object3 = new Object();
      map.put(test3, object3);
     
      assertEquals(3, map.size());
      Iterator<ScopeLevel> i = map.keySet().iterator();
      ScopeLevel test = i.next();
      assertEquals(1, test.getLevel());
      assertEquals("HELLO", test.getName());
      test = i.next();
      assertEquals(2, test.getLevel());
      assertEquals("HELLO", test.getName());
      test = i.next();
      assertEquals(3, test.getLevel());
      assertEquals("DIFFERENT", test.getName());
   }
View Full Code Here

      if (scopes.size() != 1)
         return null;
     
      // See if we have a factory
      Scope scope = scopes.iterator().next();
      ScopeLevel scopeLevel = scope.getScopeLevel();
      MetaDataRetrievalFactory factory = getMetaDataRetrievalFactory(scopeLevel);
      if (factory == null)
         return null;
     
      // We have a factory, use it
View Full Code Here

      Iterator<Scope> i = key.getScopes().iterator();
      Scope repositoryScope = i.next();
      Scope matchScope = matchScopes[index];
      while (true)
      {
         ScopeLevel keyLevel = matchScope.getScopeLevel();
         ScopeLevel repositoryLevel = repositoryScope.getScopeLevel();

         // Same level
         if (keyLevel.compareTo(repositoryLevel) == 0)
         { 
            if (matchScope.equals(repositoryScope))
View Full Code Here

   }

   private ScopeKey createScopeKey(String name, String qualifier)
   {
      int level = ScopeLevel.getScopeLevel(name);
      return new ScopeKey(new ScopeLevel(level, name), qualifier);
   }
View Full Code Here

   }

   private ScopeKey createScopeKey(String name, String qualifier)
   {
      int level = ScopeLevel.getScopeLevel(name);
      return new ScopeKey(new ScopeLevel(level, name), qualifier);
   }
View Full Code Here

   }

   private ScopeKey createScopeKey(String name, String qualifier)
   {
      int level = ScopeLevel.getScopeLevel(name);
      return new ScopeKey(new ScopeLevel(level, name), qualifier);
   }
View Full Code Here

/*     */   }
/*     */
/*     */   private ScopeKey createScopeKey(String name, String qualifier)
/*     */   {
/*  91 */     int level = ScopeLevel.getScopeLevel(name);
/*  92 */     return new ScopeKey(new ScopeLevel(level, name), qualifier);
/*     */   }
View Full Code Here

/*  65 */     Iterator i = key.getScopes().iterator();
/*  66 */     Scope repositoryScope = (Scope)i.next();
/*  67 */     Scope matchScope = this.matchScopes[index];
/*     */     while (true)
/*     */     {
/*  70 */       ScopeLevel keyLevel = matchScope.getScopeLevel();
/*  71 */       ScopeLevel repositoryLevel = repositoryScope.getScopeLevel();
/*     */
/*  74 */       if (keyLevel.compareTo(repositoryLevel) == 0)
/*     */       {
/*  76 */         if (matchScope.equals(repositoryScope)) {
/*  77 */           match = true;
View Full Code Here

TOP

Related Classes of org.jboss.metadata.spi.scope.ScopeLevel

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.