Skip to content

Commit

Permalink
Demote isEnabled(DatatypeFeature) in MapperConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Feb 9, 2023
1 parent 4fca162 commit 6c8c151
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -889,17 +889,11 @@ public final boolean requiresFullValue() {
*
* @since 2.14
*/
@Override
public final boolean isEnabled(DatatypeFeature feature) {
return _datatypeFeatures.isEnabled(feature);
}

/**
* @since 2.15
*/
public final DatatypeFeatures getDatatypeFeatures() {
return _datatypeFeatures;
}

/*
/**********************************************************
/* Other configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -863,17 +863,11 @@ public final int getSerializationFeatures() {
*
* @since 2.14
*/
@Override
public final boolean isEnabled(DatatypeFeature feature) {
return _datatypeFeatures.isEnabled(feature);
}

/**
* @since 2.15
*/
public final DatatypeFeatures getDatatypeFeatures() {
return _datatypeFeatures;
}

/**
* Method for getting provider used for locating filters given
* id (which is usually provided with filter annotations).
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/com/fasterxml/jackson/databind/cfg/MapperConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,23 @@ public final boolean hasMapperFeatures(int featureMask) {
return (_mapperFeatures & featureMask) == featureMask;
}

/**
* Accessor for checking whether give {@link DatatypeFeature}
* is enabled or not.
*
* @param feature Feature to check
*
* @return True if feature is enabled; false otherwise
*
* @since 2.15
*/
public abstract boolean isEnabled(DatatypeFeature feature);

/**
* @since 2.15
*/
public abstract DatatypeFeatures getDatatypeFeatures();

/**
* Method for determining whether annotation processing is enabled or not
* (default settings are typically that it is enabled; must explicitly disable).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,11 @@ public T withRootName(String rootName) {
/**********************************************************************
*/

@Override
public final DatatypeFeatures getDatatypeFeatures() {
return _datatypeFeatures;
}

/**
* Accessor for object used for finding out all reachable subtypes
* for supertypes; needed when a logical type name is used instead
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
import com.fasterxml.jackson.databind.introspect.*;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor;
import com.fasterxml.jackson.databind.jsonschema.SchemaAware;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap;
Expand Down Expand Up @@ -874,8 +873,8 @@ public void depositSchemaProperty(ObjectNode propertiesNode,
ser = provider.findValueSerializer(getType(), this);
}
boolean isOptional = !isRequired();
if (ser instanceof SchemaAware) {
schemaNode = ((SchemaAware) ser).getSchema(provider, hint,
if (ser instanceof com.fasterxml.jackson.databind.jsonschema.SchemaAware) {
schemaNode = ((com.fasterxml.jackson.databind.jsonschema.SchemaAware) ser).getSchema(provider, hint,
isOptional);
} else {
schemaNode = com.fasterxml.jackson.databind.jsonschema.JsonSchema
Expand Down

0 comments on commit 6c8c151

Please sign in to comment.