接口 Marshaller

  • 所有已知子接口:
    GenericMarshaller, MimeMarshaller
    所有已知实现类:
    AbstractMarshaller, Jaxb2Marshaller, JibxMarshaller, XStreamMarshaller

    public interface Marshaller
    Defines the contract for Object XML Mapping Marshallers. Implementations of this interface can serialize a given Object to an XML Stream.

    Although the marshal method accepts a java.lang.Object as its first parameter, most Marshaller implementations cannot handle arbitrary Objects. Instead, a object class must be registered with the marshaller, or have a common base class.

    从以下版本开始:
    3.0
    作者:
    Arjen Poutsma
    另请参阅:
    Unmarshaller
    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型方法说明
      voidmarshal​(Object graph, Result result)
      Marshal the object graph with the given root into the provided Result.
      booleansupports​(Class<?> clazz)
      Indicate whether this marshaller can marshal instances of the supplied type.
    • 方法详细资料

      • supports

        boolean supports​(Class<?> clazz)
        Indicate whether this marshaller can marshal instances of the supplied type.
        参数:
        clazz - the class that this marshaller is being asked if it can marshal
        返回:
        true if this marshaller can indeed marshal instances of the supplied class; false otherwise