001package votorola.g; // Copyright 2007-2008, 2011, Michael Allan.  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Votorola Software"), to deal in the Votorola Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Votorola Software, and to permit persons to whom the Votorola Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Votorola Software. THE VOTOROLA SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE VOTOROLA SOFTWARE OR THE USE OR OTHER DEALINGS IN THE VOTOROLA SOFTWARE.
002
003import votorola.g.lang.*;
004
005
006/** Utilities for <a href='http://reluk.ca/project/votorola/home.html'>project Votorola</a>.
007  */
008public @ThreadSafe class Votorola
009{
010
011    private Votorola() {}
012
013
014
015 // public static final String dd = "mike@zelea.com"; // TEST debug
016
017
018
019    /** The release version of this code, in the form "N.N.N[.N]", where N is a number.
020      * Wide releases are usually triples "N.N.N".  The optional fourth number is for
021      * narrow releases, mostly internal.
022      */
023    public static final String VERSION = "0.2.3.1"; /* DO NOT EDIT VERSION begin votorola::b::AutoEditor_Script
024        require votorola::b::Release; votorola::b::Release::auto_edit_version();
025        end votorola::b::AutoEditor_Script */
026
027
028
029    /** Returns any details of the throwable t that are known to be informative, but are
030      * not part of its standard t.toString().
031      *
032      *     @return unmessaged details as " (DETAILS)", or "" if there are none.
033      */
034    public static String unmessagedDetails( Throwable t )
035    {
036        if( t instanceof java.sql.SQLException ) // cf. votorola.g.sql.logAndClearWarnings. Unfort. not all SQLExceptions are recorded as warnings by the connection, or a call to logAndClearWarnings would be all that's needed.
037        {
038            // FIX does not t.getMessage() give these details?
039            String state = ((java.sql.SQLException)t).getSQLState(); // PostgreSQL's warning/exception message strings do not include this, so include it here
040            if( state != null ) return " (SQLState=" + state + ")";
041        }
042
043        if( t instanceof java.text.ParseException )
044        {
045            // FIX does not t.getMessage() give these details?
046            return " (errorOffset=" + ((java.text.ParseException)t).getErrorOffset() + ")";
047        }
048
049        return "";
050    }
051
052
053
054   // ` n o n - a p i ````````````````````````````````````````````````````````````````````
055
056
057    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
058      */
059    public static @Warning("non-API") final boolean AZZ_DUMMY = false;
060
061    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
062      */
063    public static @Warning("non-API") final boolean BZZ_DUMMY = false;
064
065    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
066      */
067    public static @Warning("non-API") final boolean CZZ_DUMMY = false;
068
069    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
070      */
071    public static @Warning("non-API") final boolean DZZ_DUMMY = false;
072
073    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
074      */
075    public static @Warning("non-API") final boolean EZZ_DUMMY = false;
076
077    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
078      */
079    public static @Warning("non-API") final boolean FZZ_DUMMY = false;
080
081    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
082      */
083    public static @Warning("non-API") final boolean GZZ_DUMMY = false;
084
085    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
086      */
087    public static @Warning("non-API") final boolean HZZ_DUMMY = false;
088
089    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
090      */
091    public static @Warning("non-API") final boolean IZZ_DUMMY = false;
092
093    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
094      */
095    public static @Warning("non-API") final boolean JZZ_DUMMY = false;
096
097    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
098      */
099    public static @Warning("non-API") final boolean KZZ_DUMMY = false;
100
101    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
102      */
103    public static @Warning("non-API") final boolean LZZ_DUMMY = false;
104
105    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
106      */
107    public static @Warning("non-API") final boolean MZZ_DUMMY = false;
108
109    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
110      */
111    public static @Warning("non-API") final boolean NZZ_DUMMY = false;
112
113    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
114      */
115    public static @Warning("non-API") final boolean OZZ_DUMMY = false;
116
117    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
118      */
119    public static @Warning("non-API") final boolean PZZ_DUMMY = false;
120
121    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
122      */
123    public static @Warning("non-API") final boolean QZZ_DUMMY = false;
124
125    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
126      */
127    public static @Warning("non-API") final boolean RZZ_DUMMY = false;
128
129    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
130      */
131    public static @Warning("non-API") final boolean SZZ_DUMMY = false;
132
133    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
134      */
135    public static @Warning("non-API") final boolean TZZ_DUMMY = false;
136
137    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
138      */
139    public static @Warning("non-API") final boolean UZZ_DUMMY = false;
140
141    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
142      */
143    public static @Warning("non-API") final boolean VZZ_DUMMY = false;
144
145    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
146      */
147    public static @Warning("non-API") final boolean WZZ_DUMMY = false;
148
149    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
150      */
151    public static @Warning("non-API") final boolean XZZ_DUMMY = false;
152
153    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
154      */
155    public static @Warning("non-API") final boolean YZZ_DUMMY = false;
156
157    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
158      */
159    public static @Warning("non-API") final boolean ZZZ_DUMMY = false;
160
161    /** A dummy declaration to ensure stable, referenceable page numbering in the javadoc index.
162      */
163    public static @Warning("non-API") final boolean _ZZ_DUMMY = false;
164
165
166
167}