Assert true or invalid kind for annotation exception.

@param expression
the expression
@param element
the element
@param annotationClazz
the annotation clazz
9659
public static void assertTrueOrInvalidKindForAnnotationException(boolean expression, Element element,
			Class<? extends Annotation> annotationClazz) {
		if (!expression) {
			String msg = String.format("%s %s, only class can be annotated with @%s annotation", element.getKind(),
					element, annotationClazz.getSimpleName());
			throw (new InvalidKindForAnnotationException(msg));
		}
	}
314230
@SuppressWarnings({ "rawtypes", "unchecked" })
    private static boolean isAnnotated(final Class clazz) {
        Plugin plugin = (Plugin) clazz.getAnnotation(Plugin.class);
        return plugin != null;
    }
1348121
public static void asserTrueOrUnspecifiedBeanException(boolean expression, SQLiteDatabaseSchema schema,
			SQLiteEntity entity, String foreignClassName) {
		if (!expression) {
			String msg = String.format(
					"In dao definition '%s' is referred a bean definition '%s' that is not defined in '%s' schema",
					entity.getSimpleName(), foreignClassName, schema.getElement().getQualifiedName().toString());
			throw (new InvalidDefinition(msg));
		}

	}
363240
public final void annotationTypeElementDeclarations() throws RecognitionException {
		int annotationTypeElementDeclarations_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 73) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:647:5: ( ( annotationTypeElementDeclaration ) ( annotationTypeElementDeclaration )* )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:647:7: ( annotationTypeElementDeclaration ) ( annotationTypeElementDeclaration )*
			{
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:647:7: ( annotationTypeElementDeclaration )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:647:8: annotationTypeElementDeclaration
			{
			pushFollow(FOLLOW_annotationTypeElementDeclaration_in_annotationTypeElementDeclarations2523);
			annotationTypeElementDeclaration();
			state._fsp--;
			if (state.failed) return;
			}

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:647:42: ( annotationTypeElementDeclaration )*
			loop95:
			while (true) {
				int alt95=2;
				int LA95_0 = input.LA(1);
				if ( (LA95_0==ENUM||LA95_0==Identifier||LA95_0==58||LA95_0==63||LA95_0==65||LA95_0==67||(LA95_0 >= 71 && LA95_0 <= 72)||LA95_0==77||LA95_0==83||LA95_0==85||(LA95_0 >= 92 && LA95_0 <= 94)||LA95_0==96||(LA95_0 >= 100 && LA95_0 <= 102)||(LA95_0 >= 105 && LA95_0 <= 107)||LA95_0==110||LA95_0==114||LA95_0==119) ) {
					alt95=1;
				}

				switch (alt95) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:647:43: annotationTypeElementDeclaration
					{
					pushFollow(FOLLOW_annotationTypeElementDeclaration_in_annotationTypeElementDeclarations2527);
					annotationTypeElementDeclaration();
					state._fsp--;
					if (state.failed) return;
					}
					break;

				default :
					break loop95;
				}
			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 73, annotationTypeElementDeclarations_StartIndex); }

		}
	}
794819
public static void asserTrueOrMissedAnnotationOnClassException(boolean expression, TypeElement daoElement,
			String entityName) {
		if (!expression) {
			String msg = String.format("Dao '%s' referes a bean '%s' without @%s or @%s annotation",
					daoElement.getQualifiedName(), TypeUtility.className(entityName), BindType.class.getSimpleName(),
					BindSqlType.class.getSimpleName());
			throw (new MissedAnnotationOnClass(msg));
		}

	}
1235566
public final void annotationMethodRest() throws RecognitionException {
		int annotationMethodRest_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 77) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:668:6: ( Identifier '(' ')' ( defaultValue )? )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:668:8: Identifier '(' ')' ( defaultValue )?
			{
			match(input,Identifier,FOLLOW_Identifier_in_annotationMethodRest2669); if (state.failed) return;
			match(input,36,FOLLOW_36_in_annotationMethodRest2671); if (state.failed) return;
			match(input,37,FOLLOW_37_in_annotationMethodRest2673); if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:668:27: ( defaultValue )?
			int alt103=2;
			int LA103_0 = input.LA(1);
			if ( (LA103_0==74) ) {
				alt103=1;
			}
			switch (alt103) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:668:28: defaultValue
					{
					pushFollow(FOLLOW_defaultValue_in_annotationMethodRest2676);
					defaultValue();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 77, annotationMethodRest_StartIndex); }

		}
	}
46366
public static void assertTrueOrUnknownPropertyInJQLException(boolean expression, JQLContext method,
			String columnName) {
		if (!expression) {
			throw (new UnknownPropertyInJQLException(method, columnName));
		}

	}
578975
static boolean isExpression(String expression) {

        if (null == expression) {
            return false;
        }

        //check to see if attribute has an expression
        int start = expression.indexOf("#{");
        return start != -1 && expression.indexOf('}', start+2) != -1;
    }
1266392
public static void assertNoCheckedExceptionsAreThrown(final Method method, Class<? extends Annotation> annotation) 
   {
      Class<?>[] declaredExceptions = method.getExceptionTypes();
      for (int i = 0; i < declaredExceptions.length; i++)
      {
         Class<?> exception = declaredExceptions[i];
         if (!exception.isAssignableFrom(RuntimeException.class))
         {
            throw annotation == null ? MESSAGES.methodCannotThrowCheckedException(method) : MESSAGES.methodCannotThrowCheckedException2(method, annotation);
         }
      }
   }
770313
@Override
    public boolean hasAnnotation(Element element, Class<? extends Annotation> ann) {
        List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors();
        for (AnnotationMirror annotationMirror : annotationMirrors) {
            if (annotationMirror.getAnnotationType().toString().equals(ann.getName())) {
                return true;
            }
        }
        return false;
    }
386796
public static void assertTrueOrInvalidMethodSignException(boolean expression, SQLiteModelMethod method,
			String messageFormat, Object... args) {
		if (!expression)
			throw (new InvalidMethodSignException(method, String.format(messageFormat, args)));
	}
701985
public static <A extends Annotation> boolean isAnnotationPresent(Class<?> clazz,
			Class<A> annotationType) {
		
		if (findAnnotation(clazz, annotationType) != null) return true;
		return false;
	}
421073
public static boolean isBinaryExpressionType(Expression expression, String token) {
        if (expression instanceof BinaryExpression) {
            if (token.equals(((BinaryExpression) expression).getOperation().getText())) {
                return true;
            }
        }
        return false;
    }
232833
public final void annotationTypeElementDeclaration() throws RecognitionException {
		int annotationTypeElementDeclaration_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 74) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:651:5: ( ( modifier )* annotationTypeElementRest )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:651:7: ( modifier )* annotationTypeElementRest
			{
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:651:7: ( modifier )*
			loop96:
			while (true) {
				int alt96=2;
				int LA96_0 = input.LA(1);
				if ( (LA96_0==58) ) {
					int LA96_6 = input.LA(2);
					if ( (LA96_6==Identifier) ) {
						alt96=1;
					}

				}
				else if ( (LA96_0==63||LA96_0==83||LA96_0==96||(LA96_0 >= 100 && LA96_0 <= 102)||(LA96_0 >= 106 && LA96_0 <= 107)||LA96_0==110||LA96_0==114||LA96_0==119) ) {
					alt96=1;
				}

				switch (alt96) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:651:8: modifier
					{
					pushFollow(FOLLOW_modifier_in_annotationTypeElementDeclaration2547);
					modifier();
					state._fsp--;
					if (state.failed) return;
					}
					break;

				default :
					break loop96;
				}
			}

			pushFollow(FOLLOW_annotationTypeElementRest_in_annotationTypeElementDeclaration2551);
			annotationTypeElementRest();
			state._fsp--;
			if (state.failed) return;
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 74, annotationTypeElementDeclaration_StartIndex); }

		}
	}
1276191
public static void assertTrueOrUnknownParamInJQLException(boolean expression, SQLiteModelMethod method,
			String paramName) {
		if (!expression) {
			throw (new UnknownParamUsedInJQLException(method, paramName));
		}
	}
769539
public final void annotationArgs(AnnotationDescr descr) throws RecognitionException {
		Token value=null;

		try {
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:188:3: ( LEFT_PAREN (value= ID | annotationElementValuePairs[descr] )? RIGHT_PAREN )
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:188:5: LEFT_PAREN (value= ID | annotationElementValuePairs[descr] )? RIGHT_PAREN
			{
			match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_annotationArgs945); if (state.failed) return;
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:189:5: (value= ID | annotationElementValuePairs[descr] )?
			int alt19=3;
			int LA19_0 = input.LA(1);
			if ( (LA19_0==ID) ) {
				int LA19_1 = input.LA(2);
				if ( (LA19_1==EQUALS_ASSIGN) ) {
					alt19=2;
				}
				else if ( (LA19_1==RIGHT_PAREN) ) {
					alt19=1;
				}
			}
			switch (alt19) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:190:8: value= ID
					{
					value=(Token)match(input,ID,FOLLOW_ID_in_annotationArgs962); if (state.failed) return;
					if ( state.backtracking==0 ) { if ( buildDescr ) { descr.setValue( (value!=null?value.getText():null) ); } }
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:191:10: annotationElementValuePairs[descr]
					{
					pushFollow(FOLLOW_annotationElementValuePairs_in_annotationArgs975);
					annotationElementValuePairs(descr);
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}

			match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_annotationArgs989); if (state.failed) return;
			}

		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
		}
	}
167553
public static <T extends AnnotationDescription> ElementMatcher.Junction<T> is(Annotation annotation) {
        return is(AnnotationDescription.ForLoadedAnnotation.of(annotation));
    }