net.sourceforge.pmd.util.database
Class DBURI

java.lang.Object
  extended by net.sourceforge.pmd.util.database.DBURI

public class DBURI
extends 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/password@//192.168.100.21:1521/ORCL JDBC(-ish) URL jdbc:thin:username/password@//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:
http://docs.oracle.com/javase/7/docs/api/java/net/URI.html

Constructor Summary
DBURI(String string)
          Create DBURI from a string, combining a JDBC URL and query parameters.
DBURI(String scheme, String userInfo, String host, int port, String path, String query, String fragment)
          Create a DBURI from standard individual URI components.
 
Method Summary
 String getCharacterSet()
           
 DBType getDbType()
           
 String getDriverClass()
           
 List<String> getLanguagesList()
           
 Map<String,String> getParameters()
           
 List<String> getSchemasList()
           
 List<String> getSourceCodeNamesList()
           
 int getSourceCodeType()
           
 List<String> getSourceCodeTypesList()
           
 String getSubnamePrefix()
           
 String getSubprotocol()
           
 URI getUri()
           
 String getURL()
           
 void setCharacterSet(String characterSet)
           
 void setDbType(DBType dbType)
           
 void setDriverClass(String driverClass)
           
 void setLanguagesList(List<String> languagesList)
           
 void setParameters(Map<String,String> parameters)
           
 void setSchemasList(List<String> schemasList)
           
 void setSourceCodeNamesList(List<String> sourceCodeNamesList)
           
 void setSourceCodeType(int sourceCodeType)
           
 void setSourceCodeTypesList(List<String> sourceCodeTypesList)
           
 void setSubnamePrefix(String subnamePrefix)
           
 void setSubprotocol(String subprotocol)
           
 void setUri(URI uri)
           
 void setURL(String jdbcURL)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DBURI

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

From the JDBC URL component, infer:-

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

Parameters:
string - URL string
Throws:
URISyntaxException
Exception

DBURI

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

From the JDBC URL components, infer:-

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

Parameters:
scheme -
userInfo -
host -
port -
path -
query -
fragment -
Throws:
URISyntaxException
Method Detail

getUri

public URI getUri()

setUri

public void setUri(URI uri)

getDbType

public DBType getDbType()

setDbType

public void setDbType(DBType dbType)

getSchemasList

public List<String> getSchemasList()

setSchemasList

public void setSchemasList(List<String> schemasList)

getSourceCodeTypesList

public List<String> getSourceCodeTypesList()

setSourceCodeTypesList

public void setSourceCodeTypesList(List<String> sourceCodeTypesList)

getSourceCodeNamesList

public List<String> getSourceCodeNamesList()

setSourceCodeNamesList

public void setSourceCodeNamesList(List<String> sourceCodeNamesList)

getLanguagesList

public List<String> getLanguagesList()

setLanguagesList

public void setLanguagesList(List<String> languagesList)

getDriverClass

public String getDriverClass()

setDriverClass

public void setDriverClass(String driverClass)

getCharacterSet

public String getCharacterSet()

setCharacterSet

public void setCharacterSet(String characterSet)

getSourceCodeType

public int getSourceCodeType()

setSourceCodeType

public void setSourceCodeType(int sourceCodeType)

getSubprotocol

public String getSubprotocol()

setSubprotocol

public void setSubprotocol(String subprotocol)

getSubnamePrefix

public String getSubnamePrefix()

setSubnamePrefix

public void setSubnamePrefix(String subnamePrefix)

getParameters

public Map<String,String> getParameters()

setParameters

public void setParameters(Map<String,String> parameters)

getURL

public String getURL()
Returns:
the url

setURL

public void setURL(String jdbcURL)
Parameters:
url - the url to set

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2015 InfoEther. All Rights Reserved.