Class PlexusXmlBeanConverter

java.lang.Object
org.eclipse.sisu.plexus.PlexusXmlBeanConverter
All Implemented Interfaces:
org.eclipse.sisu.plexus.PlexusBeanConverter

@Singleton @Priority(10) @Deprecated public final class PlexusXmlBeanConverter extends Object implements org.eclipse.sisu.plexus.PlexusBeanConverter
Deprecated.
PlexusBeanConverter Module that converts Plexus XML configuration into beans.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final String
    Deprecated.
     
    private final Collection<com.google.inject.spi.TypeConverterBinding>
    Deprecated.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlexusXmlBeanConverter(com.google.inject.Injector injector)
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    convert(com.google.inject.TypeLiteral role, String value)
    Deprecated.
     
    private Object
    convertText(String value, com.google.inject.TypeLiteral<?> toType)
    Deprecated.
    Converts the given string to the target type, using TypeConverters registered with the Injector.
    private static Class<?>
    loadImplementation(String name, Class<?> defaultClazz)
    Deprecated.
    Attempts to load the named implementation, uses default implementation if no name is given.
    private static <T> T
    Deprecated.
    Creates an instance of the given implementation using the default constructor.
    private static <T> T
    newImplementation(Class<T> clazz, String value)
    Deprecated.
    Creates an instance of the given implementation using the given string, assumes a public string constructor.
    private static <T> T
    newImplementation(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, Class<T> defaultClazz)
    Deprecated.
    Creates an instance of the implementation named in the current XML element, or the default if no name is given.
    private Object
    parse(org.codehaus.plexus.util.xml.pull.MXParser parser, com.google.inject.TypeLiteral<?> toType)
    Deprecated.
    Parses a sequence of XML elements and converts them to the given target type.
    private Object
    parseArray(org.codehaus.plexus.util.xml.pull.MXParser parser, com.google.inject.TypeLiteral<?> toType)
    Deprecated.
    Parses a sequence of XML elements and converts them to the appropriate array type.
    private Object
    parseBean(org.codehaus.plexus.util.xml.pull.MXParser parser, com.google.inject.TypeLiteral<?> toType, Class<?> rawType)
    Deprecated.
    Parses a sequence of XML elements and converts them to the appropriate bean type.
    parseCollection(org.codehaus.plexus.util.xml.pull.MXParser parser, com.google.inject.TypeLiteral<?> toType)
    Deprecated.
    Parses a sequence of XML elements and converts them to the appropriate Collection type.
    private static String
    parseImplementation(org.codehaus.plexus.util.xml.pull.XmlPullParser parser)
    Deprecated.
    Parses an XML element looking for the name of a custom implementation.
    private Map<String,Object>
    parseMap(org.codehaus.plexus.util.xml.pull.MXParser parser, com.google.inject.TypeLiteral<?> toType)
    Deprecated.
    Parses a sequence of XML elements and converts them to the appropriate Map type.
    private static Properties
    parseProperties(org.codehaus.plexus.util.xml.pull.XmlPullParser parser)
    Deprecated.
    Parses a sequence of XML elements and converts them to the appropriate Properties type.

    Methods inherited from class java.lang.Object

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

    • CONVERSION_ERROR

      private static final String CONVERSION_ERROR
      Deprecated.
      See Also:
    • typeConverterBindings

      private final Collection<com.google.inject.spi.TypeConverterBinding> typeConverterBindings
      Deprecated.
  • Constructor Details

    • PlexusXmlBeanConverter

      @Inject PlexusXmlBeanConverter(com.google.inject.Injector injector)
      Deprecated.
  • Method Details

    • convert

      public Object convert(com.google.inject.TypeLiteral role, String value)
      Deprecated.
      Specified by:
      convert in interface org.eclipse.sisu.plexus.PlexusBeanConverter
    • parse

      private Object parse(org.codehaus.plexus.util.xml.pull.MXParser parser, com.google.inject.TypeLiteral<?> toType) throws Exception
      Deprecated.
      Parses a sequence of XML elements and converts them to the given target type.
      Parameters:
      parser - The XML parser
      toType - The target type
      Returns:
      Converted instance of the target type
      Throws:
      Exception
    • parseProperties

      private static Properties parseProperties(org.codehaus.plexus.util.xml.pull.XmlPullParser parser) throws Exception
      Deprecated.
      Parses a sequence of XML elements and converts them to the appropriate Properties type.
      Parameters:
      parser - The XML parser
      Returns:
      Converted Properties instance
      Throws:
      Exception
    • parseMap

      private Map<String,Object> parseMap(org.codehaus.plexus.util.xml.pull.MXParser parser, com.google.inject.TypeLiteral<?> toType) throws Exception
      Deprecated.
      Parses a sequence of XML elements and converts them to the appropriate Map type.
      Parameters:
      parser - The XML parser
      Returns:
      Converted Map instance
      Throws:
      Exception
    • parseCollection

      private Collection<Object> parseCollection(org.codehaus.plexus.util.xml.pull.MXParser parser, com.google.inject.TypeLiteral<?> toType) throws Exception
      Deprecated.
      Parses a sequence of XML elements and converts them to the appropriate Collection type.
      Parameters:
      parser - The XML parser
      Returns:
      Converted Collection instance
      Throws:
      Exception
    • parseArray

      private Object parseArray(org.codehaus.plexus.util.xml.pull.MXParser parser, com.google.inject.TypeLiteral<?> toType) throws Exception
      Deprecated.
      Parses a sequence of XML elements and converts them to the appropriate array type.
      Parameters:
      parser - The XML parser
      Returns:
      Converted array instance
      Throws:
      Exception
    • parseBean

      private Object parseBean(org.codehaus.plexus.util.xml.pull.MXParser parser, com.google.inject.TypeLiteral<?> toType, Class<?> rawType) throws Exception
      Deprecated.
      Parses a sequence of XML elements and converts them to the appropriate bean type.
      Parameters:
      parser - The XML parser
      Returns:
      Converted bean instance
      Throws:
      Exception
    • parseImplementation

      private static String parseImplementation(org.codehaus.plexus.util.xml.pull.XmlPullParser parser)
      Deprecated.
      Parses an XML element looking for the name of a custom implementation.
      Parameters:
      parser - The XML parser
      Returns:
      Name of the custom implementation; otherwise null
    • loadImplementation

      private static Class<?> loadImplementation(String name, Class<?> defaultClazz)
      Deprecated.
      Attempts to load the named implementation, uses default implementation if no name is given.
      Parameters:
      name - The optional implementation name
      defaultClazz - The default implementation type
      Returns:
      Custom implementation type if one was given; otherwise default implementation type
    • newImplementation

      private static <T> T newImplementation(Class<T> clazz)
      Deprecated.
      Creates an instance of the given implementation using the default constructor.
      Parameters:
      clazz - The implementation type
      Returns:
      Instance of given implementation
    • newImplementation

      private static <T> T newImplementation(Class<T> clazz, String value)
      Deprecated.
      Creates an instance of the given implementation using the given string, assumes a public string constructor.
      Parameters:
      clazz - The implementation type
      value - The string argument
      Returns:
      Instance of given implementation, constructed using the given string
    • newImplementation

      private static <T> T newImplementation(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, Class<T> defaultClazz)
      Deprecated.
      Creates an instance of the implementation named in the current XML element, or the default if no name is given.
      Parameters:
      parser - The XML parser
      defaultClazz - The default implementation type
      Returns:
      Instance of custom implementation if one was given; otherwise instance of default type
    • convertText

      private Object convertText(String value, com.google.inject.TypeLiteral<?> toType)
      Deprecated.
      Converts the given string to the target type, using TypeConverters registered with the Injector.
      Parameters:
      value - The string value
      toType - The target type
      Returns:
      Converted instance of the target type