Skip to content

Commit

Permalink
Fix #3101
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Apr 2, 2021
1 parent c848b85 commit 44454ea
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 5 deletions.
1 change: 1 addition & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Project: jackson-databind
#3082: Dont track unknown props in buffer if `ignoreAllUnknown` is true
(contributed by David H)
#3099: Optimize "AnnotatedConstructor.call()" case by passing explicit null
#3101: Add AnnotationIntrospector.XmlExtensions interface for decoupling javax dependencies
- Fix to avoid problem with `BigDecimalNode`, scale of `Integer.MIN_VALUE` (see
[dataformats-binary#264] for details)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public abstract class AnnotationIntrospector
implements Versioned, java.io.Serializable
{
/*
/**********************************************************
/**********************************************************************
/* Helper types
/**********************************************************
/**********************************************************************
*/

/**
Expand Down Expand Up @@ -88,11 +88,70 @@ public ReferenceProperty(Type t, String n) {
public boolean isManagedReference() { return _type == Type.MANAGED_REFERENCE; }
public boolean isBackReference() { return _type == Type.BACK_REFERENCE; }
}


/**
* Add-on extension used for XML-specific configuration, needed to decouple
* format module functionality from pluggable introspection functionality
* (especially JAXB-annotation related one).
*
* @since 2.13
*/
public interface XmlExtensions
{
/**
* Method that can be called to figure out generic namespace
* property for an annotated object.
*
* @param config Configuration settings in effect
* @param ann Annotated entity to introspect
*
* @return Null if annotated thing does not define any
* namespace information; non-null namespace (which may
* be empty String) otherwise.
*/
public String findNamespace(MapperConfig<?> config, Annotated ann);

/**
* Method used to check whether given annotated element
* (field, method, constructor parameter) has indicator that suggests
* it be output as an XML attribute or not (if not, then as element)
*
* @param config Configuration settings in effect
* @param ann Annotated entity to introspect
*
* @return Null if no indicator found; {@code True} or {@code False} otherwise
*/
public Boolean isOutputAsAttribute(MapperConfig<?> config, Annotated ann);

/**
* Method used to check whether given annotated element
* (field, method, constructor parameter) has indicator that suggests
* it should be serialized as text, without element wrapper.
*
* @param config Configuration settings in effect
* @param ann Annotated entity to introspect
*
* @return Null if no indicator found; {@code True} or {@code False} otherwise
*/
public Boolean isOutputAsText(MapperConfig<?> config, Annotated ann);

/**
* Method used to check whether given annotated element
* (field, method, constructor parameter) has indicator that suggests
* it should be wrapped in a CDATA tag.
*
* @param config Configuration settings in effect
* @param ann Annotated entity to introspect
*
* @return Null if no indicator found; {@code True} or {@code False} otherwise
*/
public Boolean isOutputAsCData(MapperConfig<?> config, Annotated ann);
}

/*
/**********************************************************
/**********************************************************************
/* Factory methods
/**********************************************************
/**********************************************************************
*/

/**
Expand Down

0 comments on commit 44454ea

Please sign in to comment.