mapper.java

来自「xstream是一个把java object序列化成xml文件的开源库,轻便好用」· Java 代码 · 共 68 行

JAVA
68
字号
package com.thoughtworks.xstream.mapper;public interface Mapper {    /**     * How a class name should be represented in its serialized form.     */    String serializedClass(Class type);    /**     * How a serialized class representation should be mapped back to a real class.     */    Class realClass(String elementName);    /**     * How a class member should be represented in its serialized form.     */    String serializedMember(Class type, String memberName);    /**     * How a serialized member representation should be mapped back to a real member.     */    String realMember(Class type, String serialized);    /**     * Whether this type is a simple immutable value (int, boolean, String, URL, etc.     * Immutable types will be repeatedly written in the serialized stream, instead of using object references.     */    boolean isImmutableValueType(Class type);    Class defaultImplementationOf(Class type);    String attributeForImplementationClass();    String attributeForClassDefiningField();    String attributeForReadResolveField();    String attributeForEnumType();    /**     * Get the name of the field that acts as the default collection for an object, or return null if there is none.     *     * @param definedIn     owning type     * @param itemType      item type     * @param itemFieldName optional item element name     */    String getFieldNameForItemTypeAndName(Class definedIn, Class itemType, String itemFieldName);    Class getItemTypeForItemFieldName(Class definedIn, String itemFieldName);    ImplicitCollectionMapping getImplicitCollectionDefForFieldName(Class itemType, String fieldName);    /**     * Determine whether a specific member should be serialized.     *     * @since 1.2     */    boolean shouldSerializeMember(Class definedIn, String fieldName);    interface ImplicitCollectionMapping {        String getFieldName();        String getItemFieldName();        Class getItemType();    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?