Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2010-2012 eBusiness Information, Excilys Group Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed To in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package com.googlecode.androidannotations.processing;
import static com.sun.codemodel.JExpr._this;
import static com.sun.codemodel.JMod.FINAL;
import static com.sun.codemodel.JMod.PRIVATE;
import static com.sun.codemodel.JMod.PUBLIC;
public class EApplicationProcessor implements ElementProcessor {
	public Class<? extends AnnotationgetTarget() {
		return EApplication.class;
	public void process(Element elementJCodeModel codeModelEBeansHolder activitiesHolderthrows Exception {
		EBeanHolder holder = activitiesHolder.create(element);
		TypeElement typeElement = (TypeElementelement;
		String annotatedComponentQualifiedName = typeElement.getQualifiedName().toString();
		String generatedComponentQualifiedName = annotatedComponentQualifiedName + .;
		holder.eBean = codeModel._class( | generatedComponentQualifiedName.);
		JClass annotatedComponent = codeModel.directClass(annotatedComponentQualifiedName);
		holder.contextRef = _this();
		holder.init = holder.eBean.method(codeModel.VOID"init_");
			// onCreate
			JMethod onCreate = holder.eBean.method(codeModel.VOID"onCreate");
			JBlock onCreateBody = onCreate.body();
			onCreateBody.invoke(JExpr._super(), onCreate);
			 * Setting to null shouldn't be a problem as long as we don't allow
			 * @App and @Extra on this component
			holder.initIfActivityBody = null;
			holder.initActivityRef = null;
New to GrepCode? Check out our FAQ X