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.
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
ConstructorsConstructorDescriptionTypeResolver(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 aTypeResolverrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanResolve(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.final booleanDeprecated, for removal: This API element is subject to removal in a future version.Indicates whether some other object is "equal to" this one.final inthashCode()Deprecated, for removal: This API element is subject to removal in a future version.Returns a hash code value for this object.booleanDeprecated, for removal: This API element is subject to removal in a future version.Returns the value of thenullProofrecord component.org.docx4j.wml.Rresolve(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> resolver()Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of theresolverrecord component.final StringtoString()Deprecated, for removal: This API element is subject to removal in a future version.Returns a string representation of this record class.type()Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of thetyperecord component.
-
Constructor Details
-
TypeResolver
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
Deprecated, for removal: This API element is subject to removal in a future version.Creates an instance of aTypeResolverrecord class.
-
-
Method Details
-
canResolve
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:
canResolvein interfaceObjectResolver- 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:
resolvein interfaceObjectResolver- Parameters:
document- the WordprocessingMLPackage object representing the .docx documentplaceholder- the placeholder string to be replaced in the .docx documentobject- 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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
type
Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
resolver
Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of theresolverrecord component.- Returns:
- the value of the
resolverrecord component
-
nullProof
public boolean nullProof()Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of thenullProofrecord component.- Returns:
- the value of the
nullProofrecord component
-
ObjectResolverinterface instead.