Class DBURI


  • public class DBURI
    extends java.lang.Object
    Provide a single parameter to specify database objects to process.

    Wrap JDBC settings for use by PMD: optional parameters specify the source code to be passed to PMD, or are inherited from the associated DBType.

    A DBURI is a faux-URI: it does not have a formal specification and comprises a JDBC(-ish) URL and an optional query, e.g. jdbc : subprotocol [ : subname ] : connection details [ query ] .

    The subprotocol and optional subname parts should be a valid DBType JDBC(-ish) URL jdbc:oracle:thin:username/[email protected]//192.168.100.21:1521/ORCL JDBC(-ish) URL jdbc:thin:username/[email protected]//192.168.100.21:1521/ORCL

    The query includes one or more of these:

    characterset
    utf8
    languages
    comma-separated list of desired PMD languages
    schemas
    comma-separated list of database schemas
    sourcecodetypes
    comma-separated list of database source code types
    sourcecodenames
    comma-separated list of database source code names
    Author:
    sturton
    See Also:
    URI
    • Constructor Detail

      • DBURI

        public DBURI​(java.lang.String string)
              throws java.net.URISyntaxException
        Create DBURI from a string, combining a JDBC URL and query parameters.

        From the JDBC URL component, infer:

        • JDBC driver class
        • supported languages
        • default source code types
        • default schemas

        From the query component, define these values, overriding any defaults:

        • parsing language
        • source code types
        • schemas
        • source code
        Parameters:
        string - URL string
        Throws:
        java.net.URISyntaxException
      • DBURI

        public DBURI​(java.lang.String scheme,
                     java.lang.String userInfo,
                     java.lang.String host,
                     int port,
                     java.lang.String path,
                     java.lang.String query,
                     java.lang.String fragment)
              throws java.net.URISyntaxException
        Create a DBURI from standard individual URI components.

        From the JDBC URL components, infer:

        • JDBC driver class
        • supported languages
        • default source code types
        • default schemas

        From the query component, define these values, overriding any defaults:

        • parsing language
        • source code types
        • schemas
        • source code
        Parameters:
        scheme -
        userInfo -
        host -
        port -
        path -
        query -
        fragment -
        Throws:
        java.net.URISyntaxException
    • Method Detail

      • getUri

        public java.net.URI getUri()
      • setUri

        public void setUri​(java.net.URI uri)
      • getDbType

        public DBType getDbType()
      • setDbType

        public void setDbType​(DBType dbType)
      • getSchemasList

        public java.util.List<java.lang.String> getSchemasList()
      • setSchemasList

        public void setSchemasList​(java.util.List<java.lang.String> schemasList)
      • getSourceCodeTypesList

        public java.util.List<java.lang.String> getSourceCodeTypesList()
      • setSourceCodeTypesList

        public void setSourceCodeTypesList​(java.util.List<java.lang.String> sourceCodeTypesList)
      • getSourceCodeNamesList

        public java.util.List<java.lang.String> getSourceCodeNamesList()
      • setSourceCodeNamesList

        public void setSourceCodeNamesList​(java.util.List<java.lang.String> sourceCodeNamesList)
      • getLanguagesList

        public java.util.List<java.lang.String> getLanguagesList()
      • setLanguagesList

        public void setLanguagesList​(java.util.List<java.lang.String> languagesList)
      • getDriverClass

        public java.lang.String getDriverClass()
      • setDriverClass

        public void setDriverClass​(java.lang.String driverClass)
      • getCharacterSet

        public java.lang.String getCharacterSet()
      • setCharacterSet

        public void setCharacterSet​(java.lang.String characterSet)
      • getSourceCodeType

        public int getSourceCodeType()
      • setSourceCodeType

        public void setSourceCodeType​(int sourceCodeType)
      • getSubprotocol

        public java.lang.String getSubprotocol()
      • setSubprotocol

        public void setSubprotocol​(java.lang.String subprotocol)
      • getSubnamePrefix

        public java.lang.String getSubnamePrefix()
      • setSubnamePrefix

        public void setSubnamePrefix​(java.lang.String subnamePrefix)
      • getParameters

        public java.util.Map<java.lang.String,​java.lang.String> getParameters()
      • setParameters

        public void setParameters​(java.util.Map<java.lang.String,​java.lang.String> parameters)
      • getURL

        public java.lang.String getURL()
        Returns:
        the url
      • setURL

        public void setURL​(java.lang.String jdbcURL)
        Parameters:
        jdbcURL - the url to set
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object