Categories:
Audio (13)
Biotech (29)
Bytecode (35)
Database (77)
Framework (7)
Game (7)
General (512)
Graphics (53)
I/O (32)
IDE (2)
JAR Tools (86)
JavaBeans (16)
JDBC (89)
JDK (337)
JSP (20)
Logging (103)
Mail (54)
Messaging (8)
Network (71)
PDF (94)
Report (7)
Scripting (83)
Security (32)
Server (119)
Servlet (17)
SOAP (24)
Testing (50)
Web (19)
XML (301)
Other Resources:
Jackson Annotations Source Code
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java".
Jackson Annotations Source Code files are provided in the source packge (jackson-annotations-2.12.4-sources.jar). You can download it at Jackson Maven Website.
You can also browse Jackson Annotations Source Code below:
✍: FYIcenter.com
⏎ com/fasterxml/jackson/databind/introspect/CollectorBase.java
package com.fasterxml.jackson.databind.introspect; import java.lang.annotation.Annotation; import java.lang.annotation.Retention; import java.lang.annotation.Target; import com.fasterxml.jackson.databind.AnnotationIntrospector; import com.fasterxml.jackson.databind.util.ClassUtil; // @since 2.9 class CollectorBase { protected final static AnnotationMap[] NO_ANNOTATION_MAPS = new AnnotationMap[0]; protected final static Annotation[] NO_ANNOTATIONS = new Annotation[0]; protected final AnnotationIntrospector _intr; protected CollectorBase(AnnotationIntrospector intr) { _intr = intr; } // // // Annotation overrides ("mix over") protected final AnnotationCollector collectAnnotations(Annotation[] anns) { AnnotationCollector c = AnnotationCollector.emptyCollector(); for (int i = 0, end = anns.length; i < end; ++i) { Annotation ann = anns[i]; c = c.addOrOverride(ann); if (_intr.isAnnotationBundle(ann)) { c = collectFromBundle(c, ann); } } return c; } protected final AnnotationCollector collectAnnotations(AnnotationCollector c, Annotation[] anns) { for (int i = 0, end = anns.length; i < end; ++i) { Annotation ann = anns[i]; c = c.addOrOverride(ann); if (_intr.isAnnotationBundle(ann)) { c = collectFromBundle(c, ann); } } return c; } protected final AnnotationCollector collectFromBundle(AnnotationCollector c, Annotation bundle) { Annotation[] anns = ClassUtil.findClassAnnotations(bundle.annotationType()); for (int i = 0, end = anns.length; i < end; ++i) { Annotation ann = anns[i]; // minor optimization: by-pass 2 common JDK meta-annotations if (_ignorableAnnotation(ann)) { continue; } if (_intr.isAnnotationBundle(ann)) { // 11-Apr-2017, tatu: Also must guard against recursive definitions... if (!c.isPresent(ann)) { c = c.addOrOverride(ann); c = collectFromBundle(c, ann); } } else { c = c.addOrOverride(ann); } } return c; } // // // Defaulting ("mix under") // Variant that only adds annotations that are missing protected final AnnotationCollector collectDefaultAnnotations(AnnotationCollector c, Annotation[] anns) { for (int i = 0, end = anns.length; i < end; ++i) { Annotation ann = anns[i]; if (!c.isPresent(ann)) { c = c.addOrOverride(ann); if (_intr.isAnnotationBundle(ann)) { c = collectDefaultFromBundle(c, ann); } } } return c; } protected final AnnotationCollector collectDefaultFromBundle(AnnotationCollector c, Annotation bundle) { Annotation[] anns = ClassUtil.findClassAnnotations(bundle.annotationType()); for (int i = 0, end = anns.length; i < end; ++i) { Annotation ann = anns[i]; // minor optimization: by-pass 2 common JDK meta-annotations if (_ignorableAnnotation(ann)) { continue; } // also only defaulting, not overrides: if (!c.isPresent(ann)) { c = c.addOrOverride(ann); if (_intr.isAnnotationBundle(ann)) { c = collectFromBundle(c, ann); } } } return c; } protected final static boolean _ignorableAnnotation(Annotation a) { return (a instanceof Target) || (a instanceof Retention); } static AnnotationMap _emptyAnnotationMap() { return new AnnotationMap(); } static AnnotationMap[] _emptyAnnotationMaps(int count) { if (count == 0) { return NO_ANNOTATION_MAPS; } AnnotationMap[] maps = new AnnotationMap[count]; for (int i = 0; i < count; ++i) { maps[i] = _emptyAnnotationMap(); } return maps; } }
⏎ com/fasterxml/jackson/databind/introspect/CollectorBase.java
Â
⇒ Jackson Dataformat Extensions
⇠Jackson Data Binding Source Code
⇑ Downloading and Reviewing jackson-*.jar
⇑⇑ Jackson - Java JSON library
2022-02-19, 36321👍, 0💬
Popular Posts:
XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with ...
Apache Commons Lang 3 is the 3rd version of Apache Commons Lang, which provides a host of helper uti...
JDK 11 jdk.internal.vm.compiler .jmodis the JMOD file for JDK 11 Internal VM Compiler module. JDK 11...
JDK 11 java.rmi.jmod is the JMOD file for JDK 11 RMI (Remote Method Invocation) module. JDK 11 RMI m...
The Apache FontBox library is an open source Java tool to obtain low level information from font fil...