Package java.lang.reflect

Examples of java.lang.reflect.Member


    if( null != accessors ) {
      Iterator iter = accessors.iterator();
      while( iter.hasNext() ) {
        String str = (String) iter.next();
        // 1.b Convert each entry in a reflected method object
        Member member = HotSwapAspectInterfaceImpl.getMethodFromString( str );
        // 1.c Get the method weaver for the method
        MethodWeaver mw = HotSwapClassWeaver.getWeaver( member );
        // 1.d Register (or unregister) 'target'
        if( (FW_ACCESS_ENABLED & status) > 0 )
          mw.addFieldAccessor( this );
        else
          mw.removeFieldAccessor( this );
        //System.out.println("FieldWeaver field access changed: " + mw.getTarget().getName() );
      }
    }

    // 2. Set the method weavers for all modifiers
    // 2.a Get the registered entries
    List modifiers = (List) HotSwapClassRegister.knownFieldModifiers.get( key );
    if( null != modifiers ) {
      Iterator iter = modifiers.iterator();
      while( iter.hasNext() ) {
        String str = (String) iter.next();
        // 2.b Convert each entry in a reflected method object
        Member member = HotSwapAspectInterfaceImpl.getMethodFromString( str );
        // 2.c Get the method weaver for the method
        MethodWeaver mw = HotSwapClassWeaver.getWeaver( member );
        // 2.d Register (or unregister) 'target'
        if( (FW_MODIFICATION_ENABLED & status) > 0 )
          mw.addFieldModifier( this );
View Full Code Here


    synchronized( methodMap ) {
      result = idMgr.newId();
      // check if map must be expanded
      int mapLength = methodMap.length;
      if( mapLength <= result ) {
        Member newMap[] = new Member[ 2 * mapLength ];
        System.arraycopy( methodMap, 0, newMap, 0, mapLength );
        methodMap = newMap;
      }
      // add method to the map
      methodMap[result] = method;
View Full Code Here

    synchronized( methodMap ) {
      result = idMgr.newId();
      // check if map must be expanded
      int mapLength = methodMap.length;
      if( mapLength <= result ) {
        Member newMap[] = new Member[ 2 * mapLength ];
        System.arraycopy( methodMap, 0, newMap, 0, mapLength );
        methodMap = newMap;
      }
      // add method to the map
      methodMap[result] = method;
View Full Code Here

            return applicables.getFirst();
        }
        LinkedList maximals = new LinkedList();
        for (Iterator it = applicables.iterator(); it.hasNext();)
        {
            Member applicable = (Member)it.next();
            Class[] appArgs = MethodUtilities.getParameterTypes(applicable);
            boolean lessSpecific = false;
            for (Iterator maximal = maximals.iterator();
                maximal.hasNext();)
            {
                Member max = (Member)maximal.next();
                Class[] maxArgs = MethodUtilities.getParameterTypes(max);
                switch(moreSpecific(appArgs, maxArgs, varArg)) {
                    case MORE_SPECIFIC: {
                        maximal.remove();
                        break;
View Full Code Here

     * parameter classes represented by this ClassString object.
     */
    LinkedList getApplicables(List methods, boolean varArg) {
        LinkedList list = new LinkedList();
        for (Iterator it = methods.iterator(); it.hasNext();) {
            Member member = (Member)it.next();
            if(isApplicable(member, varArg)) {
                list.add(member);
            }
        }
        return list;
View Full Code Here

            break;
        }
       
        Object objMember = getMemberForArgs(args, true);
        if(objMember instanceof Member) {
            Member member = (Member)objMember;
            args = ((ArgumentPacker)argPackers.get(member)).packArgs(args, arguments, w);
            if(args == null) {
                return NO_SUCH_METHOD;
            }
            BeansWrapper.coerceBigDecimals(getSignature(member), args);
View Full Code Here

            args[i] = obj;
        }
       
        Object objMember = getMemberForArgs(args, false);
        if(objMember instanceof Member) {
            Member member = (Member)objMember;
            BeansWrapper.coerceBigDecimals(getSignature(member), args);
            return new MemberAndArguments(member, args);
        }
        return objMember; // either NO_SUCH_METHOD or AMBIGUOUS_METHOD
    }
View Full Code Here

      buffer.append(indent);
      buffer.append("mapped: ");
      buffer.append(TYPES[_typecode]);
      buffer.append('\n');
    }
    Member member = getMember();
    if (member != null) {
      buffer.append(indent);
      buffer.append("  ->");
      buffer.append(member.toString());
      buffer.append('\n');
    }
    int n = _childs.length;
    ParameterNode child;
    for(int i=0; i<n; i++) {
View Full Code Here

 
  /**
   * This will make sure that the member is actually accessible.
   */
  public void ensureAccessibility () {
    Member member = this.getJavaMember();
    if (member instanceof AccessibleObject) {
      ReflectionContext.getReflectionManager().ensureAccesssibility( (AccessibleObject) member );
    }
  }
View Full Code Here

    if ( property==null ) {
      return throwNoSuchProperty(c.getName() + "." + propertyName);
    }

    // Look in cache for Member first
    Member member = classAndPropertyToMemberCache.get(c, propertyName);
    if ( member!=null ) {
      try {
        Class memberClass = member.getClass();
        if ( memberClass == Method.class ) return ((Method)member).invoke(o);
        if ( memberClass == Field.class ) return ((Field)member).get(o);
      }
      catch (Exception e) {
        throwNoSuchProperty(c.getName() + "." + propertyName);
View Full Code Here

TOP

Related Classes of java.lang.reflect.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.