Code example for TypeDescriptor

Methods: getAnnotationgetType

0
 
	public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) { 
		if (SpringFacesContext.getCurrentInstance() == null) { 
			return false; 
		} 
		if (targetType.getAnnotation(FacesConverterId.class) != null) { 
			return true; 
		} 
		FacesContext facesContext = SpringFacesContext.getCurrentInstance().getFacesContext(); 
		Application application = facesContext.getApplication(); 
		return ((application != null) && (application.createConverter(targetType.getType()) != null)); 
	} 
 
	public Object convert(final Object source, final TypeDescriptor sourceType, final TypeDescriptor targetType) { 
		if (source == null) { 
			return null; 
		} 
		SpringFacesContext springFacesContext = SpringFacesContext.getCurrentInstance(); 
		FacesContext facesContext = springFacesContext.getFacesContext(); 
		try {