Logo Search packages:      
Sourcecode: libjson-java version File versions

JsonValueProcessor net::sf::json::JsonConfig::findJsonValueProcessor ( Class  beanClass,
Class  propertyType,
String  key 
) [inline]

Finds a JsonValueProcessor.
It will search the registered JsonValueProcessors in the following order:

  1. beanClass, key
  2. beanClass, type
  3. key
  4. type
Returns null if none is registered.
Used when transforming from Java to Json.

Parameters:
beanClass the class to which the property may belong
propertyType the type of the property
key the name of the property which may belong to the target class

Definition at line 274 of file JsonConfig.java.

References net::sf::json::processors::JsonValueProcessorMatcher::getMatch().

                                                                                                       {
      JsonValueProcessor jsonValueProcessor = null;
      jsonValueProcessor = (JsonValueProcessor) beanKeyMap.get( beanClass, key );
      if( jsonValueProcessor != null ) {
         return jsonValueProcessor;
      }

      jsonValueProcessor = (JsonValueProcessor) beanTypeMap.get( beanClass, propertyType );
      if( jsonValueProcessor != null ) {
         return jsonValueProcessor;
      }

      jsonValueProcessor = (JsonValueProcessor) keyMap.get( key );
      if( jsonValueProcessor != null ) {
         return jsonValueProcessor;
      }

      Object tkey = jsonValueProcessorMatcher.getMatch( propertyType, typeMap.keySet() );
      jsonValueProcessor = (JsonValueProcessor) typeMap.get( tkey );
      if( jsonValueProcessor != null ) {
         return jsonValueProcessor;
      }

      return null;
   }


Generated by  Doxygen 1.6.0   Back to index