Class DependencySerializer

java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<DependencyList>
com.fasterxml.jackson.databind.ser.std.StdSerializer<DependencyList>
org.cyclonedx.util.serializer.DependencySerializer
All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable, com.fasterxml.jackson.databind.jsonschema.SchemaAware, com.fasterxml.jackson.databind.ser.ContextualSerializer, Serializable

public class DependencySerializer extends com.fasterxml.jackson.databind.ser.std.StdSerializer<DependencyList> implements com.fasterxml.jackson.databind.ser.ContextualSerializer
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer

    com.fasterxml.jackson.databind.JsonSerializer.None
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
     
    private final String
     
    private boolean
     

    Fields inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

    _handledType
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    DependencySerializer(boolean useNamespace, String parentTagName)
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.fasterxml.jackson.databind.JsonSerializer<?>
    createContextual(com.fasterxml.jackson.databind.SerializerProvider prov, com.fasterxml.jackson.databind.BeanProperty property)
     
    private void
    processNamespace(com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator toXmlGenerator, String dependencies)
     
    void
    serialize(DependencyList dependencies, com.fasterxml.jackson.core.JsonGenerator generator, com.fasterxml.jackson.databind.SerializerProvider provider)
     
    private void
    writeJSONDependenciesWithGenerator(com.fasterxml.jackson.core.JsonGenerator generator, List<Dependency> dependencies)
     
    private void
    writeXMLDependenciesWithGenerator(com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator toXmlGenerator, List<Dependency> dependencies)
     
    private void
    writeXMLDependency(Dependency dependency, com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator generator)
     

    Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

    _neitherNull, _nonEmpty, acceptJsonFormatVisitor, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow

    Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer

    getDelegatee, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId, withIgnoredProperties

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • DependencySerializer

      public DependencySerializer(boolean useNamespace, String parentTagName)
    • DependencySerializer

      public DependencySerializer()
    • DependencySerializer

      public DependencySerializer(Class<DependencyList> t, String parentTagName)
  • Method Details

    • createContextual

      public com.fasterxml.jackson.databind.JsonSerializer<?> createContextual(com.fasterxml.jackson.databind.SerializerProvider prov, com.fasterxml.jackson.databind.BeanProperty property)
      Specified by:
      createContextual in interface com.fasterxml.jackson.databind.ser.ContextualSerializer
    • serialize

      public void serialize(DependencyList dependencies, com.fasterxml.jackson.core.JsonGenerator generator, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException
      Specified by:
      serialize in class com.fasterxml.jackson.databind.ser.std.StdSerializer<DependencyList>
      Throws:
      IOException
    • writeJSONDependenciesWithGenerator

      private void writeJSONDependenciesWithGenerator(com.fasterxml.jackson.core.JsonGenerator generator, List<Dependency> dependencies) throws IOException
      Throws:
      IOException
    • writeXMLDependenciesWithGenerator

      private void writeXMLDependenciesWithGenerator(com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator toXmlGenerator, List<Dependency> dependencies) throws IOException, XMLStreamException
      Throws:
      IOException
      XMLStreamException
    • writeXMLDependency

      private void writeXMLDependency(Dependency dependency, com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator generator) throws IOException, XMLStreamException
      Throws:
      IOException
      XMLStreamException
    • processNamespace

      private void processNamespace(com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator toXmlGenerator, String dependencies) throws XMLStreamException, IOException
      Throws:
      XMLStreamException
      IOException