Record Class TypeResolver<T>

java.lang.Object
java.lang.Record
org.wickedsource.docxstamper.replace.typeresolver.TypeResolver<T>
Type Parameters:
T - the type of the object this TypeResolver is responsible for resolving.
Record Components:
type - the class type this TypeResolver is responsible for resolving.
resolver - the resolver to resolve objects of the given type.
nullProof - a boolean value indicating whether the resolver is null-proof.
All Implemented Interfaces:
ObjectResolver

@Deprecated(since="1.6.7", forRemoval=true) public record TypeResolver<T>(Class<T> type, ITypeResolver<? super T> resolver, boolean nullProof) extends Record implements ObjectResolver
Deprecated, for removal: This API element is subject to removal in a future version.
This class is deprecated since version 1.6.7 and will be removed in a future release. Use the ObjectResolver interface instead.
The TypeResolver class is responsible for resolving objects of a specified type to objects of the DOCX4J API that can be placed in a .docx document. It implements the ObjectResolver interface.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TypeResolver(Class<T> type, ITypeResolver<? super T> resolver)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a TypeResolver object with the specified type and resolver.
    TypeResolver(Class<T> type, ITypeResolver<? super T> resolver, boolean nullProof)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates an instance of a TypeResolver record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Determines whether the given object can be resolved by the TypeResolver.
    final boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Indicates whether some other object is "equal to" this one.
    final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a hash code value for this object.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the value of the nullProof record component.
    org.docx4j.wml.R
    resolve(org.docx4j.openpackaging.packages.WordprocessingMLPackage document, String placeholder, Object object)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Resolves an object of a specified type to an object of the DOCX4J API that can be placed in a .docx document.
    ITypeResolver<? super T>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the value of the resolver record component.
    final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a string representation of this record class.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the value of the type record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TypeResolver

      public TypeResolver(Class<T> type, ITypeResolver<? super T> resolver)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a TypeResolver object with the specified type and resolver.
      Parameters:
      type - the class type this TypeResolver is responsible for resolving.
      resolver - the resolver to resolve objects of the given type.
    • TypeResolver

      public TypeResolver(Class<T> type, ITypeResolver<? super T> resolver, boolean nullProof)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an instance of a TypeResolver record class.
      Parameters:
      type - the value for the type record component
      resolver - the value for the resolver record component
      nullProof - the value for the nullProof record component
  • Method Details

    • canResolve

      public boolean canResolve(Object object)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determines whether the given object can be resolved by the TypeResolver.
      Specified by:
      canResolve in interface ObjectResolver
      Parameters:
      object - the object to be resolved
      Returns:
      true if the object can be resolved, false otherwise
    • resolve

      public org.docx4j.wml.R resolve(org.docx4j.openpackaging.packages.WordprocessingMLPackage document, String placeholder, Object object)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Resolves an object of a specified type to an object of the DOCX4J API that can be placed in a .docx document.
      Specified by:
      resolve in interface ObjectResolver
      Parameters:
      document - the WordprocessingMLPackage object representing the .docx document
      placeholder - the placeholder string to be replaced in the .docx document
      object - the object to be resolved
      Returns:
      an object of the DOCX4J API that replaces the placeholder in the .docx document
      Throws:
      DocxStamperException - if the object is not an instance of the specified type
    • toString

      public final String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public Class<T> type()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • resolver

      public ITypeResolver<? super T> resolver()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the resolver record component.
      Returns:
      the value of the resolver record component
    • nullProof

      public boolean nullProof()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the nullProof record component.
      Returns:
      the value of the nullProof record component