Class PolymorphicSchema

java.lang.Object
io.protostuff.runtime.PolymorphicSchema
All Implemented Interfaces:
Schema<Object>
Direct Known Subclasses:
ArraySchema, ArraySchemas.Base, ClassSchema, NumberSchema, ObjectSchema, PolymorphicCollectionSchema, PolymorphicEnumSchema, PolymorphicMapSchema, PolymorphicPojoCollectionSchema, PolymorphicPojoMapSchema, PolymorphicPojoSchema, PolymorphicThrowableSchema

public abstract class PolymorphicSchema extends Object implements Schema<Object>
Used when the type is either polymorphic or too complex. Unlike DerivativeSchema, this is designed to have no concept of merging.
  • Field Details

  • Constructor Details

    • PolymorphicSchema

      public PolymorphicSchema(IdStrategy strategy)
  • Method Details

    • isInitialized

      public boolean isInitialized(Object message)
      Description copied from interface: Schema
      Returns true if there is no required field or if all the required fields are set.
      Specified by:
      isInitialized in interface Schema<Object>
    • newMessage

      public Object newMessage()
      Description copied from interface: Schema
      Creates the message/object tied to this schema.
      Specified by:
      newMessage in interface Schema<Object>
    • typeClass

      public Class<? super Object> typeClass()
      Description copied from interface: Schema
      Gets the class of the message.
      Specified by:
      typeClass in interface Schema<Object>
    • getPipeSchema

      public abstract Pipe.Schema<Object> getPipeSchema()
      The pipe schema associated with this schema.
    • setValue

      protected abstract void setValue(Object value, Object owner)
      Set the value to the owner.