001: /**************************************************************************************
002: * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved. *
003: * http://aspectwerkz.codehaus.org *
004: * ---------------------------------------------------------------------------------- *
005: * The software in this package is published under the terms of the LGPL license *
006: * a copy of which has been included with this distribution in the license.txt file. *
007: **************************************************************************************/package test.mixin.perinstance;
008:
009: /**
010: * Here we use an expression:
011: *
012: * @Mixin(pointcut="within(test.mixin.perinstance.ToBeIntroduced) OR
013: * hasfield(int test.mixin.perinstance.*.thisFieldNameShouldHopefullyBeUnique_perinstance) OR
014: * hasmethod(void test.mixin.perinstance.*.thisMethodNameShouldHopefullyBeUnique_perinstance(..)) OR
015: * within(test.mixin.perinstance.ToBeIntroducedParent)",
016: * isTransient=true)
017: *
018: * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
019: */
020: public class MyImpl implements Introductions, Cloneable {
021:
022: public MyImpl(Object targetInstance) {
023: }
024:
025: public void NOT_IN_MIXIN_INTF() {
026: }
027:
028: //TODO: allow naming of mixin instead of innerClass FQN
029: public void noArgs() throws RuntimeException {
030: }
031:
032: public long longArg(long arg) {
033: return arg;
034: }
035:
036: public int intArg(int arg) {
037: return arg;
038: }
039:
040: public short shortArg(short arg) {
041: return arg;
042: }
043:
044: public double doubleArg(double arg) {
045: return arg;
046: }
047:
048: public float floatArg(float arg) {
049: return arg;
050: }
051:
052: public byte byteArg(byte arg) {
053: return arg;
054: }
055:
056: public boolean booleanArg(boolean arg) {
057: return arg;
058: }
059:
060: public char charArg(char arg) {
061: return arg;
062: }
063:
064: public Object objectArg(Object arg) {
065: return arg;
066: }
067:
068: public String[] arrayArg(String[] arg) {
069: return arg;
070: }
071:
072: public int variousArguments1(String str, int i, float f, Object o,
073: long l) throws RuntimeException {
074: return str.hashCode() + i + (int) f + o.hashCode() + (int) l;
075: }
076:
077: public int variousArguments2(float f, int i, String str1, Object o,
078: long l, String str2) throws RuntimeException {
079: return (int) f + i + str1.hashCode() + o.hashCode() + (int) l
080: + str2.hashCode();
081: }
082:
083: public void getVoid() throws RuntimeException {
084: }
085:
086: public long getLong() throws RuntimeException {
087: return 1L;
088: }
089:
090: public int getInt() throws RuntimeException {
091: return 1;
092: }
093:
094: public short getShort() throws RuntimeException {
095: return 1;
096: }
097:
098: public double getDouble() throws RuntimeException {
099: return 1.1D;
100: }
101:
102: public float getFloat() throws RuntimeException {
103: return 1.1F;
104: }
105:
106: public byte getByte() throws RuntimeException {
107: return Byte.parseByte("1");
108: }
109:
110: public char getChar() throws RuntimeException {
111: return 'A';
112: }
113:
114: public boolean getBoolean() throws RuntimeException {
115: return true;
116: }
117:
118: public void exceptionThrower() throws Throwable {
119: throw new UnsupportedOperationException("this is a test");
120: }
121:
122: public void exceptionThrowerChecked() throws CheckedException {
123: throw new CheckedException();
124: }
125: }
|