Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Jackson Data Binding Source Code
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java".
Jackson Databind Source Code files are provided in the source packge (jackson-databind-2.14.0-sources.jar). You can download it at Jackson Maven Website.
You can also browse Jackson Databind Source Code below:
✍: FYIcenter.com
⏎ com/fasterxml/jackson/databind/introspect/AnnotatedField.java
package com.fasterxml.jackson.databind.introspect;
import java.lang.reflect.*;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.util.ClassUtil;
/**
* Object that represents non-static (and usually non-transient/volatile)
* fields of a class.
*/
public final class AnnotatedField
extends AnnotatedMember
implements java.io.Serializable
{
private static final long serialVersionUID = 1L;
/**
* Actual {@link Field} used for access.
*<p>
* Transient since it cannot be persisted directly using
* JDK serialization
*/
protected final transient Field _field;
/**
* Temporary field required for JDK serialization support
*/
protected Serialization _serialization;
/*
/**********************************************************
/* Life-cycle
/**********************************************************
*/
public AnnotatedField(TypeResolutionContext contextClass, Field field, AnnotationMap annMap)
{
super(contextClass, annMap);
_field = field;
}
@Override
public AnnotatedField withAnnotations(AnnotationMap ann) {
return new AnnotatedField(_typeContext, _field, ann);
}
/**
* Method used for JDK serialization support
*/
protected AnnotatedField(Serialization ser)
{
super(null, null);
_field = null;
_serialization = ser;
}
/*
/**********************************************************
/* Annotated impl
/**********************************************************
*/
@Override
public Field getAnnotated() { return _field; }
@Override
public int getModifiers() { return _field.getModifiers(); }
@Override
public String getName() { return _field.getName(); }
@Override
public Class<?> getRawType() {
return _field.getType();
}
@Override
public JavaType getType() {
return _typeContext.resolveType(_field.getGenericType());
}
/*
/**********************************************************
/* AnnotatedMember impl
/**********************************************************
*/
@Override
public Class<?> getDeclaringClass() { return _field.getDeclaringClass(); }
@Override
public Member getMember() { return _field; }
@Override
public void setValue(Object pojo, Object value) throws IllegalArgumentException
{
try {
_field.set(pojo, value);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Failed to setValue() for field "
+getFullName()+": "+e.getMessage(), e);
}
}
@Override
public Object getValue(Object pojo) throws IllegalArgumentException
{
try {
return _field.get(pojo);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Failed to getValue() for field "
+getFullName()+": "+e.getMessage(), e);
}
}
/*
/**********************************************************
/* Extended API, generic
/**********************************************************
*/
public int getAnnotationCount() { return _annotations.size(); }
/**
* @since 2.6
*/
public boolean isTransient() { return Modifier.isTransient(getModifiers()); }
@Override
public int hashCode() {
return _field.getName().hashCode();
}
@Override
public boolean equals(Object o) {
if (o == this) return true;
if (!ClassUtil.hasClass(o, getClass())) {
return false;
}
AnnotatedField other = (AnnotatedField) o;
if (other._field == null) {
return _field == null;
} else {
return other._field.equals(_field);
}
}
@Override
public String toString() {
return "[field "+getFullName()+"]";
}
/*
/**********************************************************
/* JDK serialization handling
/**********************************************************
*/
Object writeReplace() {
return new AnnotatedField(new Serialization(_field));
}
Object readResolve() {
Class<?> clazz = _serialization.clazz;
try {
Field f = clazz.getDeclaredField(_serialization.name);
// 06-Oct-2012, tatu: Has "lost" its security override, may need to force back
if (!f.isAccessible()) {
ClassUtil.checkAndFixAccess(f, false);
}
return new AnnotatedField(null, f, null);
} catch (Exception e) {
throw new IllegalArgumentException("Could not find method '"+_serialization.name
+"' from Class '"+clazz.getName());
}
}
/**
* Helper class that is used as the workaround to persist
* Field references. It basically just stores declaring class
* and field name.
*/
private final static class Serialization
implements java.io.Serializable
{
private static final long serialVersionUID = 1L;
protected Class<?> clazz;
protected String name;
public Serialization(Field f) {
clazz = f.getDeclaringClass();
name = f.getName();
}
}
}
⏎ com/fasterxml/jackson/databind/introspect/AnnotatedField.java
Or download all of them as a single archive file:
File name: jackson-databind-2.14.0-sources.jar File size: 1187952 bytes Release date: 2022-11-05 Download
⇒ Jackson Annotations Source Code
⇐ Download and Install Jackson Binary Package
2022-03-29, ≈163🔥, 0💬
Popular Posts:
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java"....
JDK 11 jdk.internal.vm.ci.jmod is the JMOD file for JDK 11 Internal VM CI module. JDK 11 Internal VM...
MP3SPI is a Java Service Provider Interface that adds MP3 (MPEG 1/2/2.5 Layer 1/2/3) audio format su...
maven-embedder-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Embedder module. Apache Maven is a s...
JDK 11 jdk.httpserver.jmod is the JMOD file for JDK 11 HTTP Server module. JDK 11 HTTP Server module...