Skip to content

Method: create(Constructor, Token)

1: package de.fhdw.wtf.common.exception.referencer;
2:
3: import de.fhdw.wtf.common.ast.Constructor;
4: import de.fhdw.wtf.common.constants.referencer.ExceptionConstans;
5: import de.fhdw.wtf.common.token.Token;
6:
7: /**
8: * A Method of the {@link de.fhdw.wtf.walker.tasks.ConstructorReferencer} throws it.
9: *
10: */
11: public final class CyclicConstructorCallException extends ReferencerException {
12:         
13:         /**
14:          * Constructor of {@link CyclicConstructorCallException}.
15:          *
16:          * @param callingConstructor
17:          * the constructor which calls itself.
18:          *
19:          * @param token
20:          * token
21:          */
22:         private CyclicConstructorCallException(final Constructor callingConstructor, final Token token) {
23:                 super(token, ExceptionConstans.CYCLIC_CONSTRUCTOR_CALL_MESSAGE
24:                                 + callingConstructor.toStringWithoutSuperconstructors());
25:         }
26:         
27:         /**
28:          * Constructor of {@link CyclicConstructorCallException}.
29:          *
30:          * @param callingConstructor
31:          * the constructor which calls itself.
32:          *
33:          * @param token
34:          * token
35:          * @return an instance of {@link CyclicConstructorCallException}.
36:          */
37:         public static CyclicConstructorCallException create(final Constructor callingConstructor, final Token token) {
38:                 return new CyclicConstructorCallException(callingConstructor, token);
39:         }
40:         
41: }