if ( !targetDefn.isKindOf( target.getDefn( ) ) ) throw new PropertyValueException( target.getName( ), PropertyValueException.WRONG_ELEMENT_TYPE, PropertyType.ELEMENT_REF_TYPE );    return new ElementRefValue( target );
return validateElementValue( design, targetDefn, target );
	public Object validateValue( ReportDesign design, PropertyDefn defn,			Object value ) throws PropertyValueException	{		if ( value == null )			return null;		ElementDefn targetDefn = defn.getTargetElementType( );		if ( value instanceof String )		{			String name = StringUtil.trimString( (String) value );			NameSpace ns = design.getNameSpace( targetDefn.getNameSpaceID( ) );			DesignElement target = ns.getElement( name );			// Element is unresolved.			if ( target == null )				return new ElementRefValue( name );			// Check type.			if ( !targetDefn.isKindOf( target.getDefn( ) ) )				throw new PropertyValueException( target.getName( ),						PropertyValueException.WRONG_ELEMENT_TYPE,						PropertyType.ELEMENT_REF_TYPE );			// Resolved reference.			return new ElementRefValue( target );		}		if ( value instanceof DesignElement )		{			// Check type.			DesignElement target = (DesignElement) value;			if ( !targetDefn.isKindOf( target.getDefn( ) ) )				throw new PropertyValueException( target.getName( ),						PropertyValueException.WRONG_ELEMENT_TYPE,						PropertyType.ELEMENT_REF_TYPE );			// Resolved reference.			return new ElementRefValue( target );		}		// Invalid property value.		throw new PropertyValueException( value,				PropertyValueException.INVALID_VALUE,				PropertyType.ELEMENT_REF_TYPE );	}