Code example for MappingException

0
		Class accessorClass;
		try { 
			accessorClass = ReflectHelper.classForName( accessorName );
		} 
		catch (ClassNotFoundException cnfe) {
			throw new MappingException("could not find PropertyAccessor class: " + accessorName, cnfe);
		} 
		try { 
			return (PropertyAccessor) accessorClass.newInstance();
		} 
		catch (Exception e) {
			throw new MappingException("could not instantiate PropertyAccessor class: " + accessorName, e);
		} 
	} 
 
	private PropertyAccessorFactory() {} 
 
	// todo : this eventually needs to be removed 
	public static PropertyAccessor getPropertyAccessor(Class optionalClass, String type) throws MappingException {
		if ( type==null ) type = optionalClass==null || optionalClass==Map.class ? "map" : "property";
Experience pair programming with AI  Get Codota for Java