
    _Og                     p    S SK rS SKrS SKJrJr  S SKJr   " S S\R                  5      r
 " S S\5      rg)    N)	ConverterDelegateToClassmethodConverter)ClassDecoratorSettingc                   "    \ rS rSrS\4S jrSrg)ConverterSupplier	   returnc                     g N )selfs    [/Users/admin/workspace/ai/Jarvis/env/lib/python3.13/site-packages/databind/json/settings.py__call__ConverterSupplier.__call__
   s        r   N)__name__
__module____qualname____firstlineno__r   r   __static_attributes__r   r   r   r   r   	   s    ) r   r   c                   0  ^  \ rS rSr% Sr\\S'   S\R                  \\	4   SS4U 4S jjr
\ SSSS.S\R                  \R                  \R                     \R                  \R                  \R                     S	4   S4   S
SSSSS 4S jjj5       rSrU =r$ )JsonConverter   a=  Use this setting to decorate a class or to annotate a type hint to inform the JSON module to use the
specified convert when deserialize the type instead of any converter that would otherwise match the type.

Example:

```py
from databind.json.settings import JsonConverter



class MyCustomConverter(Converter):
    def __init__(self, direction: Direction) -> None:
        self.direction = direction
    def convert(self, ctx: Context) -> Any:
        ...

@JsonConverter.using_classmethods(serialize="__str__", deserialize="of")
class MyCustomType:

    def __str__(self) -> str:
        ...

    @staticmethod
    def of(s: str) -> MyCustomType:
        ...
```

The same override can also be achieved by attaching the setting to an `Annotated` type hint:


```py
Annotated[MyCustomType, JsonConverter(MyCustomConverter)]
```
supplierr	   Nc                 t   >^ [         TU ]  5         [        T[        5      (       a  U4S jU l        g TU l        g )Nc                     > T $ r   r   r   s   r   <lambda>(JsonConverter.__init__.<locals>.<lambda>7   s    Hr   )super__init__
isinstancer   r   )r   r   	__class__s    `r   r!   JsonConverter.__init__4   s)    h	**,DM$DMr   	serializedeserializeserialized_type.r&   z
str | Noner'   c                (    [        [        XUS95      $ )Nr%   )r   r   )r(   r&   r'   s      r   using_classmethods JsonConverter.using_classmethods;   s     *?]hi
 	
r   r   r   )r   r   r   r   __doc__r   __annotations__tUnionr   r!   staticmethodTypeAnyTupler*   r   __classcell__)r#   s   @r   r   r      s    !F  %):I)E!F %4 % UY
 #'$(	
quus8J0KT!QR
  
 "	

 

 
r   r   )typingr.   typing_extensionstedatabind.core.converterr   r   databind.core.settingsr   Protocolr   r   r   r   r   <module>r;      s.      M 8 
6
) 6
r   