类 SwitchingMorpher

java.lang.Object
com.sh.json.ezmorph.object.SwitchingMorpher
所有已实现的接口:
Morpher, ObjectMorpher

public class SwitchingMorpher extends Object implements ObjectMorpher
An all-purpose Morpher that can morph to several classes.
Because this Morpher accepts any class and morphs to Object it should not be added to a MorpherRegistry as it may be too generic for some cases and may result in unwanted transformations.
  • 构造器详细资料

    • SwitchingMorpher

      public SwitchingMorpher(Map classMap, MorpherRegistry morpherRegistry)
  • 方法详细资料

    • equals

      public boolean equals(Object obj)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • morph

      public Object morph(Object value)
      从接口复制的说明: ObjectMorpher
      Morphs the input object into an output object of the supported type.
      指定者:
      morph 在接口中 ObjectMorpher
      参数:
      value - The input value to be morphed
    • morphsTo

      public Class<?> morphsTo()
      从接口复制的说明: Morpher
      Returns the target Class for conversion.
      指定者:
      morphsTo 在接口中 Morpher
      返回:
      the target Class for conversion.
    • supports

      public boolean supports(Class<?> clazz)
      从接口复制的说明: Morpher
      Returns true if the Morpher supports conversion from this Class.
      指定者:
      supports 在接口中 Morpher
      参数:
      clazz - the source Class
      返回:
      true if clazz is supported by this morpher, false otherwise.