Package nexj.core.meta

Examples of nexj.core.meta.Metaclass.findAttribute()


      ).read().getInstance(0);

      assertEquals("Requested", inst.getValue("c1"));
      assertEquals("Extra", inst.getValue("b2"))// This is done without performing a lazy load.
      assertNull(inst.getValue("a1"));
      assertSame(Undefined.VALUE, inst.getValueDirect(testClass.findAttribute("b1").getOrdinal()));

      Instance assoc = (Instance)inst.getValue("b3");

      assertEquals(testClass, assoc.getLazyMetaclass());
      assertTrue(assoc.isLazy());
View Full Code Here


   public void testUncachedCalculatedValueWithInitializer()
   {
      final Symbol INITIALIZED = Symbol.define("INITIALIZED");
      final Symbol CALCULATED = Symbol.define("CALCULATED");
      final Metaclass userClass = Repository.getMetadata().getMetaclass("User");
      final int attribute = userClass.findAttribute("regionUncached").getOrdinal();
      UnitOfWork oldUOW;
      Instance instance;

      // Get value while new --> run initializer
      // Get value once committed --> run calculated value script
View Full Code Here

   public void testCachedCalculatedValueWithInitializer()
   {
      final Symbol INITIALIZED = Symbol.define("INITIALIZED");
      final Symbol CALCULATED = Symbol.define("CALCULATED");
      final Metaclass userClass = Repository.getMetadata().getMetaclass("User");
      final int attribute = userClass.findAttribute("regionCached").getOrdinal();
      UnitOfWork oldUOW;
      Instance instance;

      // Get value while new --> run initializer
      // Get value once committed --> return cached value
View Full Code Here

            attribute = mapping.getFragmentAttribute();
         }

         if (attribute == null)
         {
            attribute = metaclass.findAttribute("fragmentName");
         }

         if (attribute != null)
         {
            sFragmentName = (String)((attribute.isStatic()) ?
View Full Code Here

            sFragmentName = (String)((attribute.isStatic()) ?
               metaclass.getValue(attribute.getOrdinal()) :
                  user.getValue(attribute.getOrdinal()));
         }

         attribute = metaclass.findAttribute("partition");

         if (attribute != null)
         {
            partition = (Instance)((attribute.isStatic()) ?
               metaclass.getValue(attribute.getOrdinal()) :
View Full Code Here

               {
                  Metaclass containerMetaclass = parentMetaclass;

                  for (Pair pair = (Pair)assoc; pair != null; pair = pair.getNext())
                  {
                     Attribute attribute = containerMetaclass.findAttribute((Symbol)pair.getHead());

                     if (attribute == null)
                     {
                        break;
                     }
View Full Code Here

                  {
                     Attribute attribute = (Attribute)attrItr.next();

                     if (!attribute.isStatic() && (!m_bCompatible || attribute.isCompatible()))
                     {
                        Attribute baseAttribute = baseMeta.findAttribute(attribute.getName());

                        // don't include attributes inherited from parent type,
                        // otherwise MS.NET has problems with redeclaring same attributes
                        if (attribute.getVisibility() == Metaclass.PUBLIC &&
                            (baseAttribute == null ||
View Full Code Here

         for (int nCount = 0;; ++nCount)
         {
            String sNewName = sName + MEMBER_COLLISION_SUFFIX_DELIMITER + nCount;

            if (DEFAULT_BASE_TYPE.findAttribute(sNewName) == null &&
               metaclass.findAttribute(sNewName) == null)
            {
               return sNewName;
            }
         }
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.