зеркало из
https://github.com/iharh/notes.git
synced 2025-10-30 05:06:05 +02:00
m
Этот коммит содержится в:
родитель
1939f1ef84
Коммит
a17b4473fc
@ -1,3 +1,6 @@
|
|||||||
|
2023
|
||||||
|
Jenkins - 2023 - MongoDB for Jobseekers
|
||||||
|
!!! need
|
||||||
2022
|
2022
|
||||||
Giamas - Masterng MongoDB 6x 3rd ed
|
Giamas - Masterng MongoDB 6x 3rd ed
|
||||||
1BB10A3547DE8925B9FF3CB8D5C50513
|
1BB10A3547DE8925B9FF3CB8D5C50513
|
||||||
|
|||||||
20
db/sql/mssql/tools/sqlpackage.txt
Обычный файл
20
db/sql/mssql/tools/sqlpackage.txt
Обычный файл
@ -0,0 +1,20 @@
|
|||||||
|
https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage
|
||||||
|
https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download
|
||||||
|
https://dotnet.microsoft.com/en-us/download/dotnet/6.0
|
||||||
|
https://dotnet.microsoft.com/en-us/download/dotnet/scripts
|
||||||
|
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
|
||||||
|
dotnet tool install -g microsoft.sqlpackage
|
||||||
|
dotnet tool update -g microsoft.sqlpackage
|
||||||
|
dotnet tool uninstall -g microsoft.sqlpackage
|
||||||
|
|
||||||
|
https://learn.microsoft.com/en-us/sql/tools/sqlpackage/troubleshooting-issues-and-performance-with-sqlpackage
|
||||||
|
https://learn.microsoft.com/en-us/sql/tools/sqlpackage/troubleshooting-issues-and-performance-with-sqlpackage#azure-sql-database
|
||||||
|
/at:$AccessToken
|
||||||
|
https://learn.microsoft.com/en-us/sql/tools/sqlpackage/troubleshooting-issues-and-performance-with-sqlpackage?view=sql-server-ver16#connection
|
||||||
|
|
||||||
|
export
|
||||||
|
https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-export
|
||||||
|
https://learn.microsoft.com/en-us/rest/api/sql/2021-08-01-preview/databases/export?tabs=HTTP
|
||||||
|
! need admin creds
|
||||||
|
bacpac
|
||||||
|
https://www.youtube.com/watch?v=N0BC68j0Ex0
|
||||||
4
devops/cloud/azure/cli.txt
Обычный файл
4
devops/cloud/azure/cli.txt
Обычный файл
@ -0,0 +1,4 @@
|
|||||||
|
az
|
||||||
|
account
|
||||||
|
get-access-token
|
||||||
|
--query accessToken --output tsv
|
||||||
2
pl/java/docs/people/epam.txt
Обычный файл
2
pl/java/docs/people/epam.txt
Обычный файл
@ -0,0 +1,2 @@
|
|||||||
|
EPAM Light Talks
|
||||||
|
https://www.youtube.com/playlist?list=PLGirpy4h9wao83o_A41co0uVbb3SJQy3D
|
||||||
616
pl/java/libfws/io/file-formats/json/jackson/features/xml.txt
Обычный файл
616
pl/java/libfws/io/file-formats/json/jackson/features/xml.txt
Обычный файл
@ -0,0 +1,616 @@
|
|||||||
|
2022
|
||||||
|
https://www.baeldung.com/jackson-xml-serialization-and-deserialization
|
||||||
|
|
||||||
|
XMLOutputFactory
|
||||||
|
static final String DEFAULIMPL = "com.sun.xml.internal.stream.XMLOutputFactoryImpl";
|
||||||
|
|
||||||
|
XMLOutputFactoryImpl {
|
||||||
|
XMLStreamWriter createXMLStreamWriter(StreamResult sr, String encoding) ... {
|
||||||
|
...
|
||||||
|
return fStreamWriter = new XMLStreamWriterImpl(sr, encoding,
|
||||||
|
new PropertyManager(fPropertyManager));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
....
|
||||||
|
/**
|
||||||
|
* We need a {@link ValueSerializerModifier} to replace default <code>BeanSerializer</code>
|
||||||
|
* with XML-specific one; mostly to ensure that attribute properties are output
|
||||||
|
* before element properties.
|
||||||
|
*/
|
||||||
|
public class XmlBeanSerializerModifier extends ValueSerializerModifier
|
||||||
|
implements java.io.Serializable {
|
||||||
|
...
|
||||||
|
|
||||||
|
/*
|
||||||
|
/**********************************************************
|
||||||
|
/* Overridden methods
|
||||||
|
/**********************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* First thing to do is to find annotations regarding XML serialization,
|
||||||
|
* and wrap collection serializers.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BeanPropertyWriter> changeProperties(SerializationConfig config, // !!! called at databind
|
||||||
|
BeanDescription beanDesc, List<BeanPropertyWriter> beanProperties)
|
||||||
|
{
|
||||||
|
final AnnotationIntrospector intr = config.getAnnotationIntrospector();
|
||||||
|
for (int i = 0, len = beanProperties.size(); i < len; ++i) {
|
||||||
|
BeanPropertyWriter bpw = beanProperties.get(i);
|
||||||
|
final AnnotatedMember member = bpw.getMember();
|
||||||
|
String ns = AnnotationUtil.findNamespaceAnnotation(config, intr, member);
|
||||||
|
Boolean isAttribute = AnnotationUtil.findIsAttributeAnnotation(config, intr, member); // !!!
|
||||||
|
Boolean isText = AnnotationUtil.findIsTextAnnotation(config, intr, member);
|
||||||
|
Boolean isCData = AnnotationUtil.findIsCDataAnnotation(config, intr, member);
|
||||||
|
bpw.setInternalSetting(XmlBeanSerializerBase.KEY_XML_INFO,
|
||||||
|
new XmlInfo(isAttribute, ns, isText, isCData)); // !!!
|
||||||
|
|
||||||
|
// Actually: if we have a Collection type, easiest place to add wrapping would be here...
|
||||||
|
// or: let's also allow wrapping of "untyped" (Object): assuming it is a dynamically
|
||||||
|
// typed Collection...
|
||||||
|
if (!TypeUtil.isIndexedType(bpw.getType())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
PropertyName wrappedName = PropertyName.construct(bpw.getName(), ns);
|
||||||
|
PropertyName wrapperName = bpw.getWrapperName();
|
||||||
|
|
||||||
|
// first things first: no wrapping?
|
||||||
|
if (wrapperName == null || wrapperName == PropertyName.NO_NAME) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// no local name? Just double the wrapped name for wrapper
|
||||||
|
String localName = wrapperName.getSimpleName();
|
||||||
|
if (localName == null || localName.length() == 0) {
|
||||||
|
wrapperName = wrappedName;
|
||||||
|
}
|
||||||
|
beanProperties.set(i, new XmlBeanPropertyWriter(bpw, wrapperName, wrappedName)); // !!!
|
||||||
|
}
|
||||||
|
return beanProperties;
|
||||||
|
}
|
||||||
|
...
|
||||||
|
@Override // !!! actually we go here
|
||||||
|
// need to get List<BeanPropertyWriter> beanProperties in some way
|
||||||
|
public JsonSerializer<?> modifySerializer(SerializationConfig config,
|
||||||
|
BeanDescription beanDesc, JsonSerializer<?> serializer)
|
||||||
|
{
|
||||||
|
/* First things first: we can only handle real BeanSerializers; question
|
||||||
|
* is, what to do if it's not one: throw exception or bail out?
|
||||||
|
* For now let's do latter.
|
||||||
|
*/
|
||||||
|
if (!(serializer instanceof BeanSerializerBase)) {
|
||||||
|
return serializer;
|
||||||
|
}
|
||||||
|
return new XmlBeanSerializer((BeanSerializerBase) serializer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
JacksonXmlModule {
|
||||||
|
...
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
@Override
|
||||||
|
public void setupModule(SetupContext context)
|
||||||
|
{
|
||||||
|
// Need to modify BeanDeserializer, BeanSerializer that are used
|
||||||
|
context.addBeanSerializerModifier(new XmlBeanSerializerModifier()); // !!!
|
||||||
|
context.addBeanDeserializerModifier(new XmlBeanDeserializerModifier(_cfgNameForTextElement));
|
||||||
|
|
||||||
|
// as well as AnnotationIntrospector
|
||||||
|
context.insertAnnotationIntrospector(_constructIntrospector()); // !!!
|
||||||
|
|
||||||
|
// and finally inform XmlFactory about overrides, if need be:
|
||||||
|
if (_cfgNameForTextElement != FromXmlParser.DEFAULT_UNNAMED_TEXT_PROPERTY) {
|
||||||
|
XmlMapper m = (XmlMapper) context.getOwner();
|
||||||
|
m.setXMLTextElementName(_cfgNameForTextElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Usually this would be the first call; but here anything added will
|
||||||
|
// be stuff user may has added, so do it afterwards instead.
|
||||||
|
super.setupModule(context);
|
||||||
|
}
|
||||||
|
...
|
||||||
|
protected AnnotationIntrospector _constructIntrospector() {
|
||||||
|
return new JacksonXmlAnnotationIntrospector(_cfgDefaultUseWrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
???
|
||||||
|
https://github.com/FasterXML/jackson-dataformat-xml/blob/2.16/src/test/java/com/fasterxml/jackson/dataformat/xml/deser/builder/BuilderSimpleTest.java
|
||||||
|
setupModule...
|
||||||
|
|
||||||
|
public class XmlMapper extends ObjectMapper {
|
||||||
|
...
|
||||||
|
protected final static JacksonXmlModule DEFAULT_XML_MODULE = new JacksonXmlModule();
|
||||||
|
...
|
||||||
|
protected final static DefaultXmlPrettyPrinter DEFAULT_XML_PRETTY_PRINTER = new DefaultXmlPrettyPrinter();
|
||||||
|
|
||||||
|
// need to hold on to module instance just in case copy() is used
|
||||||
|
protected final JacksonXmlModule _xmlModule;
|
||||||
|
|
||||||
|
/*
|
||||||
|
/**********************************************************
|
||||||
|
/* Life-cycle: construction, configuration
|
||||||
|
/**********************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
public XmlMapper(XmlFactory xmlFactory, JacksonXmlModule module) {
|
||||||
|
...
|
||||||
|
super(xmlFactory, new XmlSerializerProvider(new XmlRootNameLookup()), // !!!! need to add more params here
|
||||||
|
new XmlDeserializationContext(BeanDeserializerFactory.instance));
|
||||||
|
|
||||||
|
// by default - BeanSerializerFactory
|
||||||
|
...
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
!!! MapperBuilder
|
||||||
|
!!! addModule
|
||||||
|
|
||||||
|
|
||||||
|
JsonFactory.Feature
|
||||||
|
ToXmlGenerator.Feature
|
||||||
|
WRITE_XML_DECLARATION
|
||||||
|
|
||||||
|
src/main/java/com/fasterxml/jackson/dataformat/xml/ser/XmlBeanPropertyWriter.java
|
||||||
|
...
|
||||||
|
|
||||||
|
... XmlBeanSerializer {
|
||||||
|
/**
|
||||||
|
* Main serialization method that will delegate actual output to configured
|
||||||
|
* {@link BeanPropertyWriter} instances.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void serialize(Object bean, JsonGenerator g, SerializerProvider provider) throws IOException
|
||||||
|
{
|
||||||
|
if (_objectIdWriter != null) {
|
||||||
|
_serializeWithObjectId(bean, g, provider, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
g.writeStartObject();
|
||||||
|
if (_propertyFilterId != null) {
|
||||||
|
serializeFieldsFiltered(bean, g, provider);
|
||||||
|
} else {
|
||||||
|
serializeFields(bean, g, provider);
|
||||||
|
}
|
||||||
|
g.writeEndObject();
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract class XmlBeanSerializerBase extends BeanSerializerBase
|
||||||
|
...
|
||||||
|
public XmlBeanSerializerBase(BeanSerializerBase src)
|
||||||
|
{
|
||||||
|
super(src);
|
||||||
|
|
||||||
|
// Then make sure attributes are sorted before elements, keep track
|
||||||
|
// of how many there are altogether
|
||||||
|
int attrCount = 0;
|
||||||
|
for (BeanPropertyWriter bpw : _props) {
|
||||||
|
if (_isAttribute(bpw)) { // Yup: let's build re-ordered list then // !!!
|
||||||
|
attrCount = _orderAttributesFirst(_props, _filteredProps);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_attributeCount = attrCount;
|
||||||
|
...
|
||||||
|
}
|
||||||
|
...
|
||||||
|
protected static boolean _isAttribute(BeanPropertyWriter bpw)
|
||||||
|
{
|
||||||
|
XmlInfo info = (XmlInfo) bpw.getInternalSetting(KEY_XML_INFO);
|
||||||
|
return (info != null) && info.isAttribute();
|
||||||
|
}
|
||||||
|
...
|
||||||
|
/**
|
||||||
|
* Main serialization method needs to be overridden to allow XML-specific
|
||||||
|
* extra handling, such as indication of whether to write attributes or
|
||||||
|
* elements.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void serializeFields(Object bean, JsonGenerator gen0, SerializerProvider provider)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
... use this stuff !!!
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
...Base
|
||||||
|
serializeAsField // ???
|
||||||
|
|
||||||
|
|
||||||
|
databind
|
||||||
|
|
||||||
|
BeanSerializerBase {
|
||||||
|
...
|
||||||
|
/**
|
||||||
|
* Writers used for outputting actual property values
|
||||||
|
*/
|
||||||
|
final protected BeanPropertyWriter[] _props;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optional filters used to suppress output of properties that
|
||||||
|
* are only to be included in certain views
|
||||||
|
*/
|
||||||
|
final protected BeanPropertyWriter[] _filteredProps;
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjectMapper {
|
||||||
|
...
|
||||||
|
protected DefaultSerializerProvider _serializerProvider;
|
||||||
|
protected SerializerFactory _serializerFactory;
|
||||||
|
...
|
||||||
|
public ObjectMapper(JsonFactory jf,
|
||||||
|
DefaultSerializerProvider sp, DefaultDeserializationContext dc)
|
||||||
|
{
|
||||||
|
// Default serializer factory is stateless, can just assign
|
||||||
|
_serializerFactory = BeanSerializerFactory.instance; // !!!
|
||||||
|
}
|
||||||
|
...
|
||||||
|
/**
|
||||||
|
* Method for setting specific {@link SerializerFactory} to use
|
||||||
|
* for constructing (bean) serializers.
|
||||||
|
*/
|
||||||
|
public ObjectMapper setSerializerFactory(SerializerFactory f) {
|
||||||
|
_serializerFactory = f;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SerializerFactory getSerializerFactory() {
|
||||||
|
return _serializerFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected DefaultSerializerProvider _serializerProvider(SerializationConfig config) {
|
||||||
|
return _serializerProvider.createInstance(config, _serializerFactory);
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
java/com/fasterxml/jackson/databind/ser/BeanSerializerFactory.java
|
||||||
|
// used only Here and at ObjectMapper
|
||||||
|
public final static BeanSerializerFactory instance = new BeanSerializerFactory(null);
|
||||||
|
|
||||||
|
...
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
protected JsonSerializer<Object> constructBeanOrAddOnSerializer(SerializerProvider prov,
|
||||||
|
JavaType type, BeanDescription beanDesc, boolean staticTyping)
|
||||||
|
throws JsonMappingException
|
||||||
|
{
|
||||||
|
!!!!! probably need to extend BeanSerializerFactory !!!!!
|
||||||
|
? BeanSerializerBuilder
|
||||||
|
...
|
||||||
|
List<BeanPropertyWriter> props = findBeanProperties(prov, beanDesc, builder);
|
||||||
|
if (props == null) {
|
||||||
|
props = new ArrayList<BeanPropertyWriter>();
|
||||||
|
} else {
|
||||||
|
props = removeOverlappingTypeIds(prov, beanDesc, builder, props);
|
||||||
|
}
|
||||||
|
|
||||||
|
// [databind#638]: Allow injection of "virtual" properties:
|
||||||
|
prov.getAnnotationIntrospector().findAndAddVirtualProperties(config, beanDesc.getClassInfo(), props);
|
||||||
|
|
||||||
|
// [JACKSON-440] Need to allow modification bean properties to serialize:
|
||||||
|
if (_factoryConfig.hasSerializerModifiers()) {
|
||||||
|
for (BeanSerializerModifier mod : _factoryConfig.serializerModifiers()) {
|
||||||
|
props = mod.changeProperties(config, beanDesc, props); // !!!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
|
...
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method that will try to construct a {@link BeanSerializer} for
|
||||||
|
* given class if at least one property is found, OR, if not,
|
||||||
|
* one of add-on types.
|
||||||
|
*<p>
|
||||||
|
* NOTE: behavior changed a bit
|
||||||
|
*/
|
||||||
|
public JsonSerializer<Object> findBeanOrAddOnSerializer(SerializerProvider prov, JavaType type, // ??? usages
|
||||||
|
BeanDescription beanDesc, boolean staticTyping)
|
||||||
|
throws JsonMappingException
|
||||||
|
{
|
||||||
|
// First things first: we know some types are not beans...
|
||||||
|
if (!isPotentialBeanType(type.getRawClass())) {
|
||||||
|
// 03-Aug-2012, tatu: Except we do need to allow serializers for Enums,
|
||||||
|
// as per [databind#24], [databind#2576]
|
||||||
|
if (!ClassUtil.isEnumType(type.getRawClass())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return constructBeanOrAddOnSerializer(prov, type, beanDesc, staticTyping); // !!!
|
||||||
|
}
|
||||||
|
|
||||||
|
protected JsonSerializer<?> _createSerializer2(SerializerProvider prov,
|
||||||
|
JavaType type, BeanDescription beanDesc, boolean staticTyping)
|
||||||
|
throws JsonMappingException
|
||||||
|
{
|
||||||
|
JsonSerializer<?> ser = null;
|
||||||
|
final SerializationConfig config = prov.getConfig();
|
||||||
|
...
|
||||||
|
if (ser == null) {
|
||||||
|
// Otherwise, we will check "primary types"; both marker types that
|
||||||
|
// indicate specific handling (JsonSerializable), or main types that have
|
||||||
|
// precedence over container types
|
||||||
|
ser = findSerializerByLookup(type, config, beanDesc, staticTyping);
|
||||||
|
if (ser == null) {
|
||||||
|
ser = findSerializerByPrimaryType(prov, type, beanDesc, staticTyping);
|
||||||
|
if (ser == null) {
|
||||||
|
// And this is where this class comes in: if type is not a
|
||||||
|
// known "primary JDK type", perhaps it's a bean? We can still
|
||||||
|
// get a null, if we can't find a single suitable bean property.
|
||||||
|
ser = findBeanOrAddOnSerializer(prov, type, beanDesc, staticTyping); // !!!
|
||||||
|
...
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
|
if (ser != null) {
|
||||||
|
// [databind#120]: Allow post-processing
|
||||||
|
if (_factoryConfig.hasSerializerModifiers()) {
|
||||||
|
for (BeanSerializerModifier mod : _factoryConfig.serializerModifiers()) {
|
||||||
|
ser = mod.modifySerializer(config, beanDesc, ser); // !!! just call here instead of changeProperties
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ser;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main serializer constructor method. We will have to be careful
|
||||||
|
* with respect to ordering of various method calls: essentially
|
||||||
|
* we want to reliably figure out which classes are standard types,
|
||||||
|
* and which are beans. The problem is that some bean Classes may
|
||||||
|
* implement standard interfaces (say, {@link java.lang.Iterable}.
|
||||||
|
*<p>
|
||||||
|
* Note: sub-classes may choose to complete replace implementation,
|
||||||
|
* if they want to alter priority of serializer lookups.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public JsonSerializer<Object> createSerializer(SerializerProvider prov,
|
||||||
|
JavaType origType)
|
||||||
|
throws JsonMappingException
|
||||||
|
{
|
||||||
|
// Very first thing, let's check if there is explicit serializer annotation:
|
||||||
|
final SerializationConfig config = prov.getConfig();
|
||||||
|
BeanDescription beanDesc = config.introspect(origType);
|
||||||
|
JsonSerializer<?> ser = findSerializerFromAnnotation(prov, beanDesc.getClassInfo());
|
||||||
|
if (ser != null) {
|
||||||
|
return (JsonSerializer<Object>) ser;
|
||||||
|
}
|
||||||
|
boolean staticTyping;
|
||||||
|
// Next: we may have annotations that further indicate actual type to use (a super type)
|
||||||
|
final AnnotationIntrospector intr = config.getAnnotationIntrospector();
|
||||||
|
JavaType type;
|
||||||
|
|
||||||
|
if (intr == null) {
|
||||||
|
type = origType;
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
type = intr.refineSerializationType(config, beanDesc.getClassInfo(), origType);
|
||||||
|
} catch (JsonMappingException e) {
|
||||||
|
return prov.reportBadTypeDefinition(beanDesc, e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type == origType) { // no changes, won't force static typing
|
||||||
|
staticTyping = false;
|
||||||
|
} else { // changes; assume static typing; plus, need to re-introspect if class differs
|
||||||
|
staticTyping = true;
|
||||||
|
if (!type.hasRawClass(origType.getRawClass())) {
|
||||||
|
beanDesc = config.introspect(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Slight detour: do we have a Converter to consider?
|
||||||
|
Converter<Object,Object> conv = beanDesc.findSerializationConverter();
|
||||||
|
if (conv == null) { // no, simple
|
||||||
|
return (JsonSerializer<Object>) _createSerializer2(prov, type, beanDesc, staticTyping); // !!! here
|
||||||
|
}
|
||||||
|
JavaType delegateType = conv.getOutputType(prov.getTypeFactory());
|
||||||
|
|
||||||
|
// One more twist, as per [databind#288]; probably need to get new BeanDesc
|
||||||
|
if (!delegateType.hasRawClass(type.getRawClass())) {
|
||||||
|
beanDesc = config.introspect(delegateType);
|
||||||
|
// [#359]: explicitly check (again) for @JsonSerializer...
|
||||||
|
ser = findSerializerFromAnnotation(prov, beanDesc.getClassInfo());
|
||||||
|
}
|
||||||
|
// [databind#731]: Should skip if nominally java.lang.Object
|
||||||
|
if (ser == null && !delegateType.isJavaLangObject()) {
|
||||||
|
ser = _createSerializer2(prov, delegateType, beanDesc, true); // !!! and here
|
||||||
|
}
|
||||||
|
return new StdDelegatingSerializer(conv, delegateType, ser);
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
java/com/fasterxml/jackson/databind/SerializerProvider.java
|
||||||
|
|
||||||
|
public abstract class SerializerProvider extends DatabindContext {
|
||||||
|
...
|
||||||
|
protected JsonSerializer<Object> _createUntypedSerializer(JavaType type)
|
||||||
|
throws JsonMappingException
|
||||||
|
{
|
||||||
|
...
|
||||||
|
return (JsonSerializer<Object>)_serializerFactory.createSerializer(this, type); // !!!
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method called to locate regular serializer, matching type serializer,
|
||||||
|
* and if both found, wrap them in a serializer that calls both in correct
|
||||||
|
* sequence. This method is currently only used for root-level serializer
|
||||||
|
* handling to allow for simpler caching. A call can always be replaced
|
||||||
|
* by equivalent calls to access serializer and type serializer separately.
|
||||||
|
*
|
||||||
|
* @param valueType Type for purpose of locating a serializer; usually dynamic
|
||||||
|
* runtime type, but can also be static declared type, depending on configuration
|
||||||
|
* @param cache Whether resulting value serializer should be cached or not; this is just
|
||||||
|
* a hint
|
||||||
|
* @param property When creating secondary serializers, property for which
|
||||||
|
* serializer is needed: annotations of the property (or bean that contains it)
|
||||||
|
* may be checked to create contextual serializers.
|
||||||
|
*/
|
||||||
|
public JsonSerializer<Object> findTypedValueSerializer(Class<?> valueType, boolean cache, BeanProperty property) // !!!!! really call this
|
||||||
|
throws JsonMappingException // cache = true, property = null
|
||||||
|
{
|
||||||
|
// Two-phase lookups; local non-shared cache, then shared:
|
||||||
|
JsonSerializer<Object> ser = _knownSerializers.typedValueSerializer(valueType);
|
||||||
|
if (ser != null) {
|
||||||
|
return ser;
|
||||||
|
}
|
||||||
|
// If not, maybe shared map already has it?
|
||||||
|
ser = _serializerCache.typedValueSerializer(valueType);
|
||||||
|
if (ser != null) {
|
||||||
|
return ser;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Well, let's just compose from pieces:
|
||||||
|
ser = findValueSerializer(valueType, property);
|
||||||
|
TypeSerializer typeSer = _serializerFactory.createTypeSerializer(_config,
|
||||||
|
_config.constructType(valueType));
|
||||||
|
if (typeSer != null) {
|
||||||
|
typeSer = typeSer.forProperty(property);
|
||||||
|
ser = new TypeWrappedSerializer(typeSer, ser);
|
||||||
|
}
|
||||||
|
if (cache) {
|
||||||
|
_serializerCache.addTypedSerializer(valueType, ser);
|
||||||
|
}
|
||||||
|
return ser;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_createAndCacheUntypedSerializer
|
||||||
|
_createUntypedSerializer
|
||||||
|
|
||||||
|
-> findValueSerializer
|
||||||
|
-> findContentValueSerializer
|
||||||
|
findPrimaryPropertySerializer
|
||||||
|
_findExplicitUntypedSerializer
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
java/com/fasterxml/jackson/databind/ser/DefaultSerializerProvider.java
|
||||||
|
DefaultSerializerProvier
|
||||||
|
hasSerializerFor {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MapSerializer
|
||||||
|
createContextual
|
||||||
|
ObjectArraySerializer
|
||||||
|
createContextual
|
||||||
|
|
||||||
|
public class JsonValueSerializer
|
||||||
|
extends StdSerializer<Object>
|
||||||
|
implements ContextualSerializer, JsonFormatVisitable
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void serialize(Object bean, JsonGenerator gen, SerializerProvider ctxt) throws IOException // !!!!!
|
||||||
|
{
|
||||||
|
Object value;
|
||||||
|
try {
|
||||||
|
value = _accessor.getValue(bean);
|
||||||
|
} catch (Exception e) {
|
||||||
|
value = null;
|
||||||
|
wrapAndThrow(ctxt, e, bean, _accessor.getName() + "()");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value == null) {
|
||||||
|
ctxt.defaultSerializeNull(gen);
|
||||||
|
} else {
|
||||||
|
JsonSerializer<Object> ser = _valueSerializer;
|
||||||
|
if (ser == null) {
|
||||||
|
ser = _findDynamicSerializer(ctxt, value.getClass()); // !!!
|
||||||
|
}
|
||||||
|
if (_valueTypeSerializer != null) {
|
||||||
|
ser.serializeWithType(value, gen, ctxt, _valueTypeSerializer);
|
||||||
|
} else {
|
||||||
|
ser.serialize(value, gen, ctxt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
???
|
||||||
|
BeanSerializerBase
|
||||||
|
resolve
|
||||||
|
...
|
||||||
|
????
|
||||||
|
public Object getInternalSetting(Object key) {
|
||||||
|
return (_internalSettings == null) ? null : _internalSettings.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
java/com/fasterxml/jackson/databind/ser/SerializerFactory.java
|
||||||
|
37: public abstract SerializerFactory withSerializerModifier(BeanSerializerModifier modifier);
|
||||||
|
|
||||||
|
java/com/fasterxml/jackson/databind/SerializerProvider.java
|
||||||
|
|
||||||
|
java/com/fasterxml/jackson/databind/SerializerProvider.java
|
||||||
|
|
||||||
|
public abstract class SerializerProvider extends DatabindContext {
|
||||||
|
|
||||||
|
protected JsonSerializer<Object> _createUntypedSerializer(JavaType type) throws JsonMappingException {
|
||||||
|
1503: return (JsonSerializer<Object>)_serializerFactory.createSerializer(this, type);
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// actual code flow
|
||||||
|
|
||||||
|
ObjectMapper {
|
||||||
|
...
|
||||||
|
protected DefaultSerializerProvider _serializerProvider(SerializationConfig config) {
|
||||||
|
return _serializerProvider.createInstance(config, _serializerFactory); // !!!
|
||||||
|
// !!! XmlSerializerProvider, BeanSerializerFactory
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
public class XmlSerializerProvider extends DefaultSerializerProvider {
|
||||||
|
...
|
||||||
|
public XmlSerializerProvider(XmlSerializerProvider src, SerializationConfig config, SerializerFactory f) { // ???
|
||||||
|
super(src, config, f);
|
||||||
|
_rootNameLookup = src._rootNameLookup;
|
||||||
|
}
|
||||||
|
...
|
||||||
|
@SuppressWarnings("resource")
|
||||||
|
@Override
|
||||||
|
// gen -> ToXmlGenerator
|
||||||
|
// ??? SerializerProvider
|
||||||
|
public void serializeValue(JsonGenerator gen, Object value) throws IOException {
|
||||||
|
...
|
||||||
|
|
||||||
|
//!!! cls - .databind.ObjectNode -> SerializableSerializer
|
||||||
|
// ObjectNode is pretty dumb !!!
|
||||||
|
|
||||||
|
// From super-class implementation
|
||||||
|
final JsonSerializer<Object> ser = findTypedValueSerializer(cls, true, null);
|
||||||
|
try {
|
||||||
|
ser.serialize(value, gen, this); // ObjectNode
|
||||||
|
} catch (Exception e) { // but wrap RuntimeExceptions, to get path information
|
||||||
|
throw _wrapAsIOE(gen, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
????? .serialize(...)
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract class DefaultSerializerProvider
|
||||||
|
extends SerializerProvider
|
||||||
|
implements java.io.Serializable // since 2.1; only because ObjectWriter needs it
|
||||||
|
{
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
@!!! XmlMapper:164
|
||||||
@ -1,4 +1,6 @@
|
|||||||
2020
|
2020
|
||||||
|
https://wearecommunity.io/events/java-community-meetup/talks/4593
|
||||||
|
!!! need to look
|
||||||
DanVega - Spring Boot Testing Basics: How to Unit Test & Integration Test REST Controllers of 15:03
|
DanVega - Spring Boot Testing Basics: How to Unit Test & Integration Test REST Controllers of 15:03
|
||||||
https://www.youtube.com/watch?v=pNiRNRgi5Ws
|
https://www.youtube.com/watch?v=pNiRNRgi5Ws
|
||||||
KrisFoster - Spring Boot Testing a REST Controller with Unit, Integration & Acceptance Tests 0:00 of 25:46
|
KrisFoster - Spring Boot Testing a REST Controller with Unit, Integration & Acceptance Tests 0:00 of 25:46
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
2020
|
|
||||||
https://keyholesoftware.com/2020/06/30/quick-start-spring-security-5-oauth2-login/
|
|
||||||
https://www.baeldung.com/spring-security-oauth-attack-redirect
|
|
||||||
@ -1,3 +1,8 @@
|
|||||||
|
2023
|
||||||
|
https://spring.io/blog/2023/08/22/tackling-the-oauth2-client-component-model-in-spring-security
|
||||||
|
2020
|
||||||
|
https://keyholesoftware.com/2020/06/30/quick-start-spring-security-5-oauth2-login/
|
||||||
|
https://www.baeldung.com/spring-security-oauth-attack-redirect
|
||||||
2018
|
2018
|
||||||
https://dzone.com/articles/secure-spring-rest-with-spring-security-and-oauth2
|
https://dzone.com/articles/secure-spring-rest-with-spring-security-and-oauth2
|
||||||
https://habr.com/ru/company/southbridge/blog/690978/
|
https://habr.com/ru/company/southbridge/blog/690978/
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
|
https://docs.spring.io/spring-authorization-server/docs/current/reference/html/index.html
|
||||||
|
https://docs.spring.io/spring-authorization-server/docs/current/reference/html/getting-started.html
|
||||||
|
|
||||||
https://github.com/Baeldung/spring-security-oauth/tree/master/oauth-resource-server
|
https://github.com/Baeldung/spring-security-oauth/tree/master/oauth-resource-server
|
||||||
|
|
||||||
|
2023
|
||||||
|
|
||||||
2021
|
2021
|
||||||
https://www.baeldung.com/spring-security-oauth-resource-server
|
https://www.baeldung.com/spring-security-oauth-resource-server
|
||||||
2018
|
2018
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
2022
|
2023
|
||||||
https://www.baeldung.com/jbang-guide
|
https://www.baeldung.com/jbang-guide
|
||||||
|
http://www.mastertheboss.com/java/java-scripting-with-jbang/
|
||||||
|
2022
|
||||||
http://www.mastertheboss.com/java/jbang-vs-jshell/
|
http://www.mastertheboss.com/java/jbang-vs-jshell/
|
||||||
|
|||||||
2
pl/java/tools/shell/jbang/docs/cheatsheet.txt
Обычный файл
2
pl/java/tools/shell/jbang/docs/cheatsheet.txt
Обычный файл
@ -0,0 +1,2 @@
|
|||||||
|
2021
|
||||||
|
https://www.mastertheboss.com/java/jbang-cheatsheet-2021/
|
||||||
@ -1,4 +1,6 @@
|
|||||||
|
https://learn.microsoft.com/en-us/dotnet/core/tools/
|
||||||
https://github.com/dotnet/core
|
https://github.com/dotnet/core
|
||||||
|
https://github.com/dotnet/sdk/
|
||||||
|
|
||||||
extra
|
extra
|
||||||
mono
|
mono
|
||||||
|
|||||||
@ -1,8 +1,29 @@
|
|||||||
|
https://dotnet.microsoft.com/en-us/download
|
||||||
|
|
||||||
https://learn.microsoft.com/en-us/dotnet/core/install/
|
https://learn.microsoft.com/en-us/dotnet/core/install/
|
||||||
https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual
|
|
||||||
https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu
|
https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu
|
||||||
|
https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual
|
||||||
|
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
|
||||||
|
!! intended mainly for CI
|
||||||
|
|
||||||
|
export DOTNET_ROOT=$HOME/.dotnet
|
||||||
|
export PATH="$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools"
|
||||||
|
|
||||||
|
https://dotnet.microsoft.com/en-us/download/dotnet/scripts
|
||||||
|
|
||||||
|
|
||||||
aur
|
aur
|
||||||
dotnet-sdk
|
dotnet-sdk
|
||||||
dotnet-host
|
dotnet-host
|
||||||
dotnet-runtime
|
dotnet-runtime
|
||||||
|
|
||||||
|
./dotnet-install.sh
|
||||||
|
-h|-?|--help
|
||||||
|
--dry-run,-DryRun
|
||||||
|
prints repeatable invocation with all params at the end
|
||||||
|
--verbose,-Verbose
|
||||||
|
... other stuff (os, arch, runtime, ...)
|
||||||
|
-c LTS
|
||||||
|
-i,--install-dir
|
||||||
|
|
||||||
|
./dotnet-install.sh -c LTS --verbose --dry-run
|
||||||
|
|||||||
10
pl/ms/dotnet/tools/tools.txt
Обычный файл
10
pl/ms/dotnet/tools/tools.txt
Обычный файл
@ -0,0 +1,10 @@
|
|||||||
|
https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools
|
||||||
|
|
||||||
|
dotnet tool
|
||||||
|
search
|
||||||
|
install
|
||||||
|
-g <tool>
|
||||||
|
update
|
||||||
|
-g <tool>
|
||||||
|
uninstall
|
||||||
|
-g <tool>
|
||||||
@ -4,4 +4,4 @@ https://github.com/rust-lang/regex
|
|||||||
|
|
||||||
2023
|
2023
|
||||||
https://blog.burntsushi.net/regex-internals/
|
https://blog.burntsushi.net/regex-internals/
|
||||||
https://habr.com/ru/articles/749730/
|
https://habr.com/ru/articles/755940/
|
||||||
|
|||||||
Загрузка…
x
Ссылка в новой задаче
Block a user