Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2010-2011 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 http://www.apache.org/licenses/LICENSE-2.0 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.model;
 
 import java.util.List;
 
 
 
 public enum AndroidRes {
 
 	STRING(.StringRes.class"getString""java.lang.String"), //
 	STRING_ARRAY(.StringArrayRes.class"getStringArray""java.lang.String[]"), //
 	ANIMATION(.AnimationRes.class"getAnimation""android.content.res.XmlResourceParser""android.view.animation.Animation"), //
 	HTML(.HtmlRes.class"getString""java.lang.CharSequence""android.text.Spanned"), BOOLEAN(.BooleanRes.class"getBoolean""java.lang.Boolean""boolean"), //
 	COLOR_STATE_LIST(.ColorStateListRes.class"getColorStateList""android.content.res.ColorStateList"), //
 	DIMENSION(.DimensionRes.class"getDimension""java.lang.Float""float"), //
 	DIMENSION_PIXEL_OFFSET(.DimensionPixelOffsetRes.class"getDimensionPixelOffset""java.lang.Integer""int"), //
 	DIMENSION_PIXEL_SIZE(.DimensionPixelSizeRes.class"getDimensionPixelSize""java.lang.Integer""int"), //
 	DRAWABLE(.DrawableRes.class"getDrawable""android.graphics.drawable.Drawable"), //
 	INT_ARRAY(.IntArrayRes.class"getIntArray""int[]"), //
 	INTEGER(.IntegerRes.class"getInteger""java.lang.Integer""int"), //
 	LAYOUT(.LayoutRes.class"getLayout""android.content.res.XmlResourceParser"), //
 	MOVIE(.MovieRes.class"getMovie""android.graphics.Movie"), //
 	TEXT(.TextRes.class"getText""java.lang.CharSequence"), //
 	TEXT_ARRAY(.TextArrayRes.class"getTextArray""java.lang.CharSequence"), //
 	COLOR(.ColorRes.class"getColor""int""java.lang.Integer");
 
 	private final Class<? extends Annotationtarget;
 	private final String resourceMethodName;
 	private final List<StringallowedTypes;
 	private final Res rInnerClass;
 
 	AndroidRes(Res rInnerClassClass<? extends AnnotationtargetString resourceMethodNameString... allowedTypes) {
 		this. = target;
 		this. = resourceMethodName;
 		this. = Arrays.asList(allowedTypes);
 		this. = rInnerClass;
 	}
 
 	public Res getRInnerClass() {
 		return ;
 	}
 
 	public Class<? extends AnnotationgetTarget() {
 		return ;
 	}
 
 	}
 
 	public List<StringgetAllowedTypes() {
 		return ;
 	}
 
 	public int idFromElement(Element element) {
 		Annotation annotation = element.getAnnotation();
 		Method valueMethod = .getMethods()[0];
 		try {
 			return (IntegervalueMethod.invoke(annotation);
 		} catch (Exception e) {
 			throw new RuntimeException(e);
 		}
 	}
New to GrepCode? Check out our FAQ X