Package nexj.core.meta

Examples of nexj.core.meta.Member


            {
               load();
            }

            Selector sel = m_metaclass.findSelector(sym.toString());
            Member member = (sel == null) ? null : sel.findMember(nArgCount - 1);

            if (member == null)
            {
               Object value = Undefined.VALUE;

               if (nArgCount == 1)
               {
                  value = findAnnotation(sym.toString(), Undefined.VALUE);
               }

               if (value == Undefined.VALUE)
               {
                  // This should throw an exception
                  m_metaclass.getSelector(sym.toString()).getMember(nArgCount - 1);
               }

               machine.returnValue(value, nArgCount);

               return false;
            }

            if (member.isAttribute())
            {
               if (nArgCount == 1)
               {
                  machine.returnValue(
                     (member.isStatic()) ?
                        m_metaclass.getValue(((Attribute)member).getOrdinal()) :
                        getValue(((Attribute)member).getOrdinal()),
                     nArgCount);
               }
               else if (nArgCount == 2)
               {
                  Object value = machine.getArg(1, nArgCount);

                  if (member.isStatic())
                  {
                     m_metaclass.setValue(((Attribute)member).getOrdinal(), value);
                  }
                  else
                  {
                     setValue(((Attribute)member).getOrdinal(), value);
                  }

                  machine.returnValue(value, nArgCount);
               }
               else
               {
                  throw new ScriptingException("err.scripting.maxArgCount",
                     new Object[]{toString(),
                        Primitive.ONE_INTEGER,
                        Primitive.createInteger(nArgCount - 1)});
               }

               return false;
            }
            else
            {
               if (member.isStatic())
               {
                  machine.setArg(0, nArgCount, m_metaclass);
               }
               else
               {
View Full Code Here


      {
         throw new MetadataException("err.meta.workflow.negativeEventArgCount",
            new Object[]{sName, getActivity().getFlow().getFullName()});
      }

      Member member = getTarget().getSelector(sName).getMember(nArgCount);

      if (!(member instanceof Event))
      {
         throw new MetadataException("err.meta.workflow.invalidEvent",
            new Object[]{sName, member.getMetaclass().getName(),
            getActivity().getFlow().getFullName()});
      }

      setEvent((Event)member);
   }
View Full Code Here

      {
         throw new MetadataException("err.meta.workflow.negativeEventArgCount",
            new Object[]{sName, getFullName()});
      }

      Member member = getTarget().getSelector(sName).getMember(nArgCount);

      if (!(member instanceof Event))
      {
         throw new MetadataException("err.meta.workflow.invalidEvent",
            new Object[]{sName, member.getMetaclass().getName(), getFullName()});
      }

      setEvent((Event)member);
   }
View Full Code Here

            m_context.setTransient(bTransient);

            Object[] arguments = invocation.getArguments();
            Metaclass metaclass = metadata.getMetaclass(tobj.getClassName());
            Selector selector = metaclass.getSelector(sEventName);
            Member member;
            int nArgCount;

            if (arguments != null)
            {
               nArgCount = arguments.length;
               member = selector.getMember(nArgCount);

               if (member.isStatic() && tobj.getValueCount() != 0)
               {
                  throw new RequestException("err.rpc.requestTO");
               }
            }
            else
            {
               nArgCount = tobj.getValueCount();
               member = selector.findMember(0);

               if (member == null || member.isStatic())
               {
                  member = selector.getMember(nArgCount);

                  if (!member.isStatic())
                  {
                     throw new RequestException("err.rpc.argCount",
                        new Object[]{member.getName(), metaclass.getName()});
                  }
               }
               else
               {
                  nArgCount = 0;
               }
            }

            if (member.isAttribute())
            {
               throw new RequestException("err.rpc.attributeInvocation",
                  new Object[]{member.getName(), metaclass.getName()});
            }

            if (m_context.isProtected() && member.getVisibility() != Metaclass.PUBLIC)
            {
               throw new SecurityViolationException("err.rpc.eventVisibility",
                  new Object[]{member.getName(), metaclass.getName()});
            }

            Event event = (Event)member;
            Object[] args = new Object[nArgCount + 1];
View Full Code Here

         return null;
      }

      for (int i = selector.getMaxArgCount(); i >= 0; --i)
      {
         Member member = selector.findMember(i);

         if (!(member instanceof Event) || member.isStatic() != bStatic)
         {
            continue;
         }

         Event event = (Event)member;
View Full Code Here

         boolean bStarted = false;
         Selector selector = (Selector)selItr.next();

         for (Iterator/*<Member>*/ memItr = selector.getMemberIterator(); memItr.hasNext();)
         {
            Member member = (Member)memItr.next();

            if (!(member instanceof Event) ||
                bStatic != member.isStatic() ||
                !isExportedEvent((Event)member))
            {
               continue;
            }

            if (!bStarted)
            {
               // add each event as a resource
               m_writer.openElement("resource");
                  m_writer.writeAttribute("path", member.getName());
                  m_writer.writeAttribute("queryType", "text/xml");
               m_writer.closeElement();

               m_writer.openElement("param");
                  m_writer.writeAttribute("href", "#authorization");
View Full Code Here

         Node resource = null;
         int nChildCount = 1;

         for (Iterator/*<Member>*/ memItr = selector.getMemberIterator(); memItr.hasNext();)
         {
            Member member = (Member)memItr.next();

            if (!(member instanceof Event) || bStatic != member.isStatic())
            {
               continue;
            }

            Event event = (Event)member;

            if (resource == null) // first iteration for this selector, <resource> not found yet
            {
               resource = XMLUtil.findChildElement(parent, "resource", "path", member.getName());
               assertNotNull(resource);
               assertEquals(2, resource.getAttributes().getLength());
               assertEquals("text/xml", XMLUtil.getStringAttr(resource, "queryType"));

               Node param = XMLUtil.findChildElement(resource, "param");
View Full Code Here

TOP

Related Classes of nexj.core.meta.Member

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.