Package org.codehaus.aspectwerkz.reflect

Examples of org.codehaus.aspectwerkz.reflect.ConstructorInfo


                continue;
            }
            final CtConstructor[] constructors = ctClass.getConstructors();
            for (int i = 0; i < constructors.length; i++) {
                CtConstructor constructor = constructors[i];
                ConstructorInfo constructorInfo = JavassistConstructorInfo.getConstructorInfo(constructor, context
                        .getLoader());
                ExpressionContext ctx = new ExpressionContext(PointcutType.EXECUTION, constructorInfo, constructorInfo);
                if (constructorFilter(definition, ctx)) {
                    continue;
                }
View Full Code Here


                String calleeClassName = newInvocationStruct.className;
                String calleeMethodName = INIT_METHOD_NAME;
                String calleeMethodDesc = newInvocationStruct.ctorDesc;
                int joinPointHash = AsmHelper.calculateMethodHash(calleeMethodName, calleeMethodDesc);
                ClassInfo classInfo = AsmClassInfo.getClassInfo(calleeClassName, m_loader);
                ConstructorInfo calleeConstructorInfo = classInfo.getConstructor(joinPointHash);
                if (calleeConstructorInfo == null) {
                    super.visitTypeInsn(opcode, desc);//we failed
                    System.err.println(
                            "AW::WARNING " +
                            "metadata structure could not be build for method ["
View Full Code Here

            return true;
        }
        if (!(o instanceof ConstructorInfo)) {
            return false;
        }
        ConstructorInfo constructorInfo = (ConstructorInfo) o;
        if (!m_declaringTypeName.equals(constructorInfo.getDeclaringType().getName())) {
            return false;
        }
        if (!m_member.name.equals(constructorInfo.getName())) {
            return false;
        }
        ClassInfo[] parameterTypes = constructorInfo.getParameterTypes();
        if (m_parameterTypeNames.length != parameterTypes.length) {//check on names length for lazyness optim
            return false;
        }
        for (int i = 0; i < m_parameterTypeNames.length; i++) {
            if (!m_parameterTypeNames[i].equals(parameterTypes[i].getName())) {
View Full Code Here

     */

    public ConstructorInfo getConstructor(final int hash) {

        ConstructorInfo constructor = (ConstructorInfo) m_constructors.get(hash);

        if (constructor == null && getSuperclass() != null) {

            constructor = getSuperclass().getConstructor(hash);

View Full Code Here

     */

    public ConstructorInfo getConstructor(final int hash) {

        ConstructorInfo constructor = (ConstructorInfo) m_constructors.get(hash);

        if (constructor == null && getSuperclass() != null) {

            constructor = getSuperclass().getConstructor(hash);

View Full Code Here

            return true;
        }
        if (!(o instanceof ConstructorInfo)) {
            return false;
        }
        ConstructorInfo constructorInfo = (ConstructorInfo) o;
        if (!m_declaringType.getName().equals(constructorInfo.getDeclaringType().getName())) {
            return false;
        }
        if (!m_member.getName().equals(constructorInfo.getName())) {
            return false;
        }
        Class[] parameterTypes1 = ((Constructor) m_member).getParameterTypes();
        ClassInfo[] parameterTypes2 = constructorInfo.getParameterTypes();
        if (parameterTypes1.length != parameterTypes2.length) {
            return false;
        }
        for (int i = 0; i < parameterTypes1.length; i++) {
            if (!parameterTypes1[i].getName().equals(parameterTypes2[i].getName())) {
View Full Code Here

            }

        } else if (data instanceof ConstructorInfo) {

            ConstructorInfo constructorInfo = (ConstructorInfo) data;

            if (node.getDeclaringTypePattern().matchType(constructorInfo.getDeclaringType())) {

                return null;// it might not match further because of modifiers etc

            }
View Full Code Here

    public Object visit(ASTConstructorPattern node, Object data) {

        if (data instanceof ConstructorInfo) {

            ConstructorInfo constructorMetaData = (ConstructorInfo) data;

            if (node.getDeclaringTypePattern().matchType(constructorMetaData.getDeclaringType())

                && visitModifiers(node, constructorMetaData)

                && visitParameters(node, constructorMetaData.getParameterTypes())) {

                return Boolean.TRUE;

            }
View Full Code Here

     * @return the annotation or null
     */
    public static Annotation getAnnotation(final String annotationName, final Constructor constructor) {
        ClassLoader loader = constructor.getDeclaringClass().getClassLoader();
        ClassInfo classInfo = AsmClassInfo.getClassInfo(constructor.getDeclaringClass().getName(), loader);
        ConstructorInfo constructorInfo = classInfo.getConstructor(ReflectHelper.calculateHash(constructor));
        return AsmAnnotations.getAnnotation(annotationName, constructorInfo);
    }
View Full Code Here

     * @return the annotations in a list (can be empty)
     */
    public static List getAnnotations(final String annotationName, final Constructor constructor) {
        ClassLoader loader = constructor.getDeclaringClass().getClassLoader();
        ClassInfo classInfo = AsmClassInfo.getClassInfo(constructor.getDeclaringClass().getName(), loader);
        ConstructorInfo constructorInfo = classInfo.getConstructor(ReflectHelper.calculateHash(constructor));
        return AsmAnnotations.getAnnotations(annotationName, constructorInfo);
    }
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.reflect.ConstructorInfo

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.