Package nexj.core.meta

Examples of nexj.core.meta.Attribute$InverseDependency


   public Object getValue(int nOrdinal)
   {
      assert !isLazy();

      Object value = getValueDirect(nOrdinal);
      Attribute attribute = m_metaclass.getInstanceAttribute(nOrdinal);

      if (!(value instanceof Undefined) && attribute.isCached() &&
         (!attribute.isCalculated() || attribute.isPersistent() ||
            m_context.getGeneration() == InvocationContext.GEN_NEW || m_nState >= NEW))
      {
         return value;
      }

      ++m_nLoadingDepth;

      try
      {
         if (m_nLoadingDepth > MAX_LOADING_DEPTH)
         {
            throw new IterationCountException("err.persistence.circularLoading",
               new Object[]{attribute.getName(), m_metaclass.getName()});
         }

         if (m_nState == NEW && value == Undefined.VALUE && attribute.getInitializer() != Undefined.VALUE)
         {
            return setCalcValue(attribute,
               m_context.getMachine().invoke(attribute.getInitializerFunction(), new Pair(this)));
         }

         if (attribute.getValueFunction() != null)
         {
            return setCalcValue(attribute,
               m_context.getMachine().invoke(attribute.getValueFunction(), new Pair(this)));
         }

         if (attribute.isCollection() && attribute.isPersistent() &&
            (m_nState == CLEAN || m_nState == DIRTY))
         {
            InstanceList list = new InstanceArrayList(0);

            setValueDirect(nOrdinal, list);
            list.setAssociation(this, attribute, true);

            return list;
         }

         load(attribute.getSymbol());

         return getValueDirect(nOrdinal);
      }
      finally
      {
View Full Code Here


    */
   public Object getValue(String sName)
   {
      load();

      Attribute attribute = m_metaclass.findAttribute(sName);

      if (attribute == null)
      {
         Object value = findAnnotation(sName, Undefined.VALUE);

         if (value != Undefined.VALUE)
         {
            return value;
         }

         // This will throw an exception
         attribute = m_metaclass.getAttribute(sName);
      }

      if (attribute.isStatic())
      {
         return m_metaclass.getValue(attribute.getOrdinal());
      }

      return getValue(attribute.getOrdinal());
   }
View Full Code Here

    */
   public Object getValue(String sName, String sFallbackName)
   {
      load();

      Attribute attribute = m_metaclass.findAttribute(sName);

      if (attribute == null)
      {
         if (sFallbackName == null)
         {
            return null;
         }

         attribute = m_metaclass.getAttribute(sFallbackName);
      }

      if (attribute.isStatic())
      {
         return m_metaclass.getValue(attribute.getOrdinal());
      }

      return getValue(attribute.getOrdinal());
   }
View Full Code Here

               }
            }
         }
         else
         {
            Attribute reverse = attribute.getReverse();

            if (reverse != null)
            {
               int nRevOrdinal = reverse.getOrdinal();

               Instance instance = (Instance)value;

               setValueDirect(attribute.getOrdinal(), instance);
View Full Code Here

   {
      load();

      if (m_nState == CLEAN)
      {
         Attribute attribute = m_metaclass.getInstanceAttribute(nOrdinal);

         if (!attribute.isCollection() && value != Undefined.VALUE)
         {
            if (attribute.isPersistent())
            {
               setDirty();
            }
            else
            {
View Full Code Here

    */
   public Object getOldValue(String sName)
   {
      load();

      Attribute attribute = m_metaclass.getAttribute(sName);

      if (attribute.isStatic())
      {
         return m_metaclass.getValue(attribute.getOrdinal());
      }

      return getOldValue(attribute.getOrdinal());
   }
View Full Code Here

    */
   public Object getPreValue(String sName)
   {
      load();

      Attribute attribute = m_metaclass.getAttribute(sName);

      if (attribute.isStatic())
      {
         return m_metaclass.getValue(attribute.getOrdinal());
      }

      return getPreValue(attribute.getOrdinal());
   }
View Full Code Here

      if (isLazy())
      {
         return findAnnotation(sName, defaultValue);
      }

      Attribute attribute = m_metaclass.findAttribute(sName);

      if (attribute == null)
      {
         return findAnnotation(sName, defaultValue);
      }

      Object value;

      if (attribute.isStatic())
      {
         value = m_metaclass.getValueDirect(attribute.getOrdinal());
      }
      else
      {
         value = getValueDirect(attribute.getOrdinal());
      }

      if (value instanceof Undefined)
      {
         value = defaultValue;
View Full Code Here

      if (isLazy())
      {
         return false;
      }

      Attribute attribute = m_metaclass.findAttribute(sName);

      if (attribute == null)
      {
         return false;
      }

      if (attribute.isStatic())
      {
         return !(m_metaclass.getValueDirect(attribute.getOrdinal()) instanceof Undefined);
      }

      return !(getValueDirect(attribute.getOrdinal()) instanceof Undefined);
   }
View Full Code Here

      if (isLazy())
      {
         return false;
      }

      Attribute attribute = m_metaclass.getAttribute(sName);

      if (attribute.isStatic())
      {
         return false;
      }

      return isDirty(attribute.getOrdinal());
   }
View Full Code Here

TOP

Related Classes of nexj.core.meta.Attribute$InverseDependency

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.