Class Providers


  • public final class Providers
    extends java.lang.Object
    Factory for providers of source code for JavaParser. Providers that have no parameter for encoding but need it will use UTF-8.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  Providers.PreProcessor  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.nio.charset.Charset UTF8  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Providers()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Provider provider​(java.io.File file)  
      static Provider provider​(java.io.File file, java.nio.charset.Charset encoding)  
      static Provider provider​(java.io.InputStream input)  
      static Provider provider​(java.io.InputStream input, java.nio.charset.Charset encoding)  
      static Provider provider​(java.io.Reader reader)  
      static Provider provider​(java.lang.String source)  
      static Provider provider​(java.nio.file.Path path)  
      static Provider provider​(java.nio.file.Path path, java.nio.charset.Charset encoding)  
      static Provider resourceProvider​(java.lang.ClassLoader classLoader, java.lang.String pathToResource, java.nio.charset.Charset encoding)
      Provide a Provider from the resource found in class loader with the provided encoding.
      As resource is accessed through a class loader, a leading "/" is not allowed in pathToResource
      static Provider resourceProvider​(java.lang.String pathToResource)
      Provide a Provider from the resource found in the current class loader with UTF-8 encoding.
      As resource is accessed through a class loader, a leading "/" is not allowed in pathToResource
      static Provider resourceProvider​(java.lang.String pathToResource, java.nio.charset.Charset encoding)
      Provide a Provider from the resource found in the current class loader with the provided encoding.
      As resource is accessed through a class loader, a leading "/" is not allowed in pathToResource
      • Methods inherited from class java.lang.Object

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

      • UTF8

        public static final java.nio.charset.Charset UTF8
    • Constructor Detail

      • Providers

        private Providers()
    • Method Detail

      • provider

        public static Provider provider​(java.io.Reader reader)
      • provider

        public static Provider provider​(java.io.InputStream input,
                                        java.nio.charset.Charset encoding)
      • provider

        public static Provider provider​(java.io.InputStream input)
      • provider

        public static Provider provider​(java.io.File file,
                                        java.nio.charset.Charset encoding)
                                 throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • provider

        public static Provider provider​(java.io.File file)
                                 throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • provider

        public static Provider provider​(java.nio.file.Path path,
                                        java.nio.charset.Charset encoding)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • provider

        public static Provider provider​(java.nio.file.Path path)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • provider

        public static Provider provider​(java.lang.String source)
      • resourceProvider

        public static Provider resourceProvider​(java.lang.ClassLoader classLoader,
                                                java.lang.String pathToResource,
                                                java.nio.charset.Charset encoding)
                                         throws java.io.IOException
        Provide a Provider from the resource found in class loader with the provided encoding.
        As resource is accessed through a class loader, a leading "/" is not allowed in pathToResource
        Throws:
        java.io.IOException
      • resourceProvider

        public static Provider resourceProvider​(java.lang.String pathToResource,
                                                java.nio.charset.Charset encoding)
                                         throws java.io.IOException
        Provide a Provider from the resource found in the current class loader with the provided encoding.
        As resource is accessed through a class loader, a leading "/" is not allowed in pathToResource
        Throws:
        java.io.IOException
      • resourceProvider

        public static Provider resourceProvider​(java.lang.String pathToResource)
                                         throws java.io.IOException
        Provide a Provider from the resource found in the current class loader with UTF-8 encoding.
        As resource is accessed through a class loader, a leading "/" is not allowed in pathToResource
        Throws:
        java.io.IOException