Java Doc for IdUtil.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.iapi.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.iapi.util.IdUtil

IdUtil
abstract public class IdUtil (Code)
Utility class for parsing and producing string representations of ids. This class supports both delimited and un-delimited ids.

The syntax for an id follows.

 id := delim-id | unDelim-id
 delim-id := "[""|[any char but quote]]+"
 undelim-id := (a-z|A-Z|anyunicodeletter)[a-z|A-Z|_|0-9|anyunicodeletter|anyunicodedigit]*
 In the syntax braces show grouping. '*' means repeat 0 or more times.
 '|' means or. '+' means repeat 1 or more times. 
 

In addition this class provides support for qualified names. A qualified name is a dot (.) separated list of ids.

Limitations:

  1. Unicode escape sequences in ids are not supported.
  2. Escape sequences (\n...) are not supported.


Field Summary
final public static  intDBCP_SCHEMA_NAME
    
final public static  intDBCP_SQL_JAR_NAME
    


Method Summary
public static  StringappendId(String id, String list)
     Append an id in external form. the list with the id appended.
public static  StringdeleteId(String id, String list)
     Delete an id from a list of ids.
Parameters:
  id - an id in normal form (quotes removed, upshifted)
Parameters:
  list - a comma separated list of ids in externalform (possibly delmited or not upshifted).
public static  StringdelimitId(String id)
     Delimit the identifier provided.
public static  Stringdups(String[] l)
     Return an IdList with all the ids that are repeated in l.
public static  StringgetUserAuthorizationId(String userName)
    
public static  StringgetUserNameFromURLProps(Properties params)
     Get user name from URL properties.
public static  booleanidOnList(String id, String list)
     Return true if the id provided is on the list provided.
public static  Stringintersect(String[] l1, String[] l2)
     Return an IdList with all the ids that in l1 and l2 or null if not ids are on both lists.
public static  StringmkIdList(String[] ids)
     Produce a string form of an idList from an array of normalized ids.
public static  StringmkQualifiedName(String id1, String id2)
     Produce a delimited two part qualified name from two un-delimited identifiers.
public static  StringmkQualifiedName(String[] ids)
     Make a string form of a qualified name from the array of ids provided.
public static  String[][]parseDbClassPath(String input, boolean normalizeToUpper)
     Scan a database classpath from the string provided.
public static  StringparseId(String s)
     Convert the String provided to an ID.
public static  StringparseId(StringReader r, boolean normalize, boolean normalizeToUpper)
     Read an id from the StringReader provided.
public static  String[]parseIdList(String p)
     Scan a list of ids from the string provided.
public static  String[]parseQualifiedName(String s, boolean normalizeToUpper)
     Scan a qualified name from the String provided.
public static  String[]parseQualifiedName(StringReader r, boolean normalizeToUpper)
     Scan a qualified name from a StringReader.
public static  StringpruneDups(String l)
    

Field Detail
DBCP_SCHEMA_NAME
final public static int DBCP_SCHEMA_NAME(Code)
Index of the schema name in a jar name on a db classpath



DBCP_SQL_JAR_NAME
final public static int DBCP_SQL_JAR_NAME(Code)
Index of the sql jar name in a jar name on a db classpath





Method Detail
appendId
public static String appendId(String id, String list) throws StandardException(Code)
Append an id in external form. the list with the id appended.
exception:
  StandardException - oops



deleteId
public static String deleteId(String id, String list) throws StandardException(Code)
Delete an id from a list of ids.
Parameters:
  id - an id in normal form (quotes removed, upshifted)
Parameters:
  list - a comma separated list of ids in externalform (possibly delmited or not upshifted). the list with the id deleted or null if theresulting list has no ids. If 'id' is not on 'list'this returns list unchanged.
exception:
  StandardException - oops.



delimitId
public static String delimitId(String id)(Code)
Delimit the identifier provided. the delimited identifier.



dups
public static String dups(String[] l)(Code)
Return an IdList with all the ids that are repeated in l.
Parameters:
  l - a list of ids in normal form.



getUserAuthorizationId
public static String getUserAuthorizationId(String userName) throws StandardException(Code)
Map userName to authorizationId
exception:
  StandardException - on error



getUserNameFromURLProps
public static String getUserNameFromURLProps(Properties params)(Code)
Get user name from URL properties. Handles the case of "" user.
exception:
  StandardException - on error



idOnList
public static boolean idOnList(String id, String list) throws StandardException(Code)
Return true if the id provided is on the list provided.
Parameters:
  id - an id in normal form
Parameters:
  list - a list of ids in external form.
exception:
  StandardException - oops.



intersect
public static String intersect(String[] l1, String[] l2)(Code)
Return an IdList with all the ids that in l1 and l2 or null if not ids are on both lists.
Parameters:
  l1 - An array of ids in normal form
Parameters:
  l2 - An array of ids in nomral form



mkIdList
public static String mkIdList(String[] ids)(Code)
Produce a string form of an idList from an array of normalized ids.



mkQualifiedName
public static String mkQualifiedName(String id1, String id2)(Code)
Produce a delimited two part qualified name from two un-delimited identifiers. the result.



mkQualifiedName
public static String mkQualifiedName(String[] ids)(Code)
Make a string form of a qualified name from the array of ids provided.



parseDbClassPath
public static String[][] parseDbClassPath(String input, boolean normalizeToUpper) throws StandardException(Code)
Scan a database classpath from the string provided. This returns an array with one qualified name per entry on the classpath. The constants above describe the content of the returned names. This raises an an exception if the string does not contain a valid database class path.
 classpath := item[:item]*
 item := id.id
 In the syntax braces ([]) show grouping. '*' means repeat 0 or more times.
 The syntax for id is defined in IdUtil.
 

Classpath returned is a two part name.
If the class path is empty then this returns an array of zero length.
exception:
  StandardException - Oops



parseId
public static String parseId(String s) throws StandardException(Code)
Convert the String provided to an ID. Throw an exception iff the string does not contain only a valid external form for an id. This is a convenience routine that simply uses getId(StringReader) to do the work.

See the header for getId below for restrictions.
exception:
  StandardException - Oops




parseId
public static String parseId(StringReader r, boolean normalize, boolean normalizeToUpper) throws StandardException(Code)
Read an id from the StringReader provided.
Parameters:
  normalize - true means return ids in nomral form, false meansreturn them as they were entered.

Raise an exception if the first thing in the StringReaderis not a valid id.
exception:
  StandardException - Ooops.




parseIdList
public static String[] parseIdList(String p) throws StandardException(Code)
Scan a list of ids from the string provided. This returns an array with id per entry. This raises an an exception if the string does not contain a valid list of names.
exception:
  StandardException - Oops



parseQualifiedName
public static String[] parseQualifiedName(String s, boolean normalizeToUpper) throws StandardException(Code)
Scan a qualified name from the String provided. Raise an excepion if the string does not contain a qualified name.
Parameters:
  s - The string to be parsed
Parameters:
  normalizeToUpper - If true then undelimited names are converted to upper case (the ANSI standard). If false then undelimited names are converted to lower case (used when the source database is Informix Foundation). An array of strings made by breaking the input string at its dots, '.'.
exception:
  StandardException - Oops



parseQualifiedName
public static String[] parseQualifiedName(StringReader r, boolean normalizeToUpper) throws StandardException(Code)
Scan a qualified name from a StringReader. Return an array of Strings with 1 entry per name scanned. Raise an exception if the StringReader does not contain a valid qualified name.
Parameters:
  r - A StringReader for the string to be parsed
Parameters:
  normalizeToUpper - If true then undelimited names are converted to upper case (the ANSI standard). If false then undelimited names are converted to lower case (used when the source database is Informix Foundation). An array of strings made by breaking the input string at its dots, '.'.
exception:
  StandardException - Oops



pruneDups
public static String pruneDups(String l) throws StandardException(Code)
Return an IdList with all the duplicate ids removed
Parameters:
  l - a list of ids in external form.
exception:
  StandardException - Oops.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.