View Javadoc

    1   /***************************************************************************************
    2    * Copyright (c) Jonas Bonér, Alexandre Vasseur. All rights reserved.                 *
    3    * http://aspectwerkz.codehaus.org                                                    *
    4    * ---------------------------------------------------------------------------------- *
    5    * The software in this package is published under the terms of the LGPL license      *
    6    * a copy of which has been included with this distribution in the license.txt file.  *
    7    **************************************************************************************/
    8   package org.codehaus.aspectwerkz.joinpoint.impl;
    9
    10  import org.codehaus.aspectwerkz.joinpoint.Signature;
    11  import org.codehaus.aspectwerkz.transform.TransformationConstants;
    12
    13  import java.lang.reflect.Modifier;
    14
    15  /***
    16   * The class static initializer signature
    17   *
    18   * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
    19   */
    20  public class StaticInitializerSignatureImpl implements Signature {
    21
    22      private final static int CLINIT_MODIFIERS = Modifier.STATIC;//TODO whatelse
    23
    24      private final Class m_declaringType;
    25
    26      public StaticInitializerSignatureImpl(Class declaringType) {
    27          m_declaringType = declaringType;
    28      }
    29
    30      public Class getDeclaringType() {
    31          return m_declaringType;
    32      }
    33
    34      public int getModifiers() {
    35          return CLINIT_MODIFIERS;
    36      }
    37
    38      public String getName() {
    39          return TransformationConstants.CLINIT_METHOD_NAME;
    40      }
    41
    42      public String toString() {
    43          StringBuffer sb = new StringBuffer();
    44          sb.append(m_declaringType.getName());
    45          sb.append('.');
    46          sb.append(TransformationConstants.CLINIT_METHOD_NAME);
    47          return sb.toString();
    48      }
    49  }