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/ser/impl/PropertyBasedObjectIdGenerator.java
package com.fasterxml.jackson.databind.ser.impl; import com.fasterxml.jackson.annotation.ObjectIdGenerator; import com.fasterxml.jackson.annotation.ObjectIdGenerators; import com.fasterxml.jackson.databind.introspect.ObjectIdInfo; import com.fasterxml.jackson.databind.ser.*; public class PropertyBasedObjectIdGenerator extends ObjectIdGenerators.PropertyGenerator { private static final long serialVersionUID = 1L; protected final BeanPropertyWriter _property; public PropertyBasedObjectIdGenerator(ObjectIdInfo oid, BeanPropertyWriter prop) { this(oid.getScope(), prop); } protected PropertyBasedObjectIdGenerator(Class<?> scope, BeanPropertyWriter prop) { super(scope); _property = prop; } /** * We must override this method, to prevent errors when scopes are the same, * but underlying class (on which to access property) is different. */ @Override public boolean canUseFor(ObjectIdGenerator<?> gen) { if (gen.getClass() == getClass()) { PropertyBasedObjectIdGenerator other = (PropertyBasedObjectIdGenerator) gen; if (other.getScope() == _scope) { /* 26-Jul-2012, tatu: This is actually not enough, because the property * accessor within BeanPropertyWriter won't work for other property fields * (see [https://github.com/FasterXML/jackson-module-jaxb-annotations/issues/9] * for details). * So we need to verify that underlying property is actually the same. */ return (other._property == _property); } } return false; } @Override public Object generateId(Object forPojo) { try { return _property.get(forPojo); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new IllegalStateException("Problem accessing property '" +_property.getName()+"': "+e.getMessage(), e); } } @Override public ObjectIdGenerator<Object> forScope(Class<?> scope) { return (scope == _scope) ? this : new PropertyBasedObjectIdGenerator(scope, _property); } @Override public ObjectIdGenerator<Object> newForSerialization(Object context) { // No state, can return this return this; } @Override public com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey key(Object key) { if (key == null) { return null; } // should we use general type for all; or type of property itself? return new IdKey(getClass(), _scope, key); } }
⏎ com/fasterxml/jackson/databind/ser/impl/PropertyBasedObjectIdGenerator.java
Â
⇒ Jackson Dataformat Extensions
⇠Jackson Data Binding Source Code
⇑ Downloading and Reviewing jackson-*.jar
⇑⇑ Jackson - Java JSON library
2022-02-19, 36320👍, 0💬
Popular Posts:
Xalan-Java, Version 2.7.1, is an XSLT processor for transforming XML documents into HTML, text, or o...
Apache Ant is a Java-based build tool. In theory, it is kind of like make, without make's wrinkles. ...
JDK 11 jdk.crypto.ec.jmod is the JMOD file for JDK 11 Crypto EC module. JDK 11 Crypto EC module comp...
The JSR 105 XML Digital Signature 1.0.1 FCS implementation provides an API and implementation that a...
Apache Axis2 is the core engine for Web services. It is a complete re-design and re-write of the wid...