Package wt.util

A treasure trove of utilities and standard objects that should be used: Cache Encoder LocalizedResource WTContext WTMessage WTProperties WTStandardBooleanFormat WTStandardDateFormat WTStringUtilities WTThread and many others; this is a good place for a developer to browse.

See:
          Description

Interface Summary
AppletListener Interface for class that supports applet start, stop, and destroy methods.
DebugFlag This class defines the flags that can be used to configure debug information capturing.
Dumpable The Dumpable interface defines a method that will be implemented for a class that will determine how to dump the contents, or state, of the object.
Evolvable

Supported API: true

Extendable: false
LocalizableMessage Represents a type that will support a request for a localized message.
Message Root tagging interface for all Windchill message types.
ProgressData Interface containing attributes for use with progress applications (e.g., progress feedback).
WTAttributeNameIfc WTAttributeNameIfc specifies persistInfo AttributeDescriptor relative paths

Supported API: true
Extendable: false
 

Class Summary
Cache A fixed size, most recently used object cache.
CallRegistrar This class allows one body of code to quickly register the entry and exit of significant calls or states and another body of code to easily monitor the number and total duration of such occurrences on both a per thread and per CallRegistrar instance basis.
CaseKind Enumeration of constants for kinds of cases.
CollationKeyFactory A factory for object collation keys.
DebugProperties This utility class provides access to all the properties that are used to configure information capture to aid in debugging.
DebugType This class defines the types of elements that can be the target of debug configuration.
DebugWriter This class provides standard methods for reporting various categories of information to aid in debugging.
DumpUtil This class provides a general method that will use reflection to dump the contents, or state, of a given object.
Encoder The Encoder class provides methods to encode and decode serializable objects to and from character strings.
EncodingConverter The class contains utility methods for converting a String into a MIME format called "x-www-form-urlencoded" and vice versa.
EnumeratorVector EnumeratorVector is wrapper class for java.util.Vector that implements java.util.Enumeration.
LocaleIndependentMessage LocaleIndependentMessage is the wrapper class for getting a message which is independent of locale.
LocaleUtilities LocaleUtilities provides utility methods for working with Locales.
LocalizedResource LocalizedResource contains the utility methods for finding and opening the resource that best matches the given Locale.
LogOutputStream A filter output stream for writing log entries.
MPInputStream A MP input stream is a filter that allows a business class to read consecutive multipart data object bodies whilst alleviating the associated pain.
ProcessLauncher Performs the process using another thread to start sending output, before processing has completed.
ResourceLister A utility to list resource files found in the local class path.
SortedEnumeration An enumeration that returns objects in sorted order.
TempFileOutputStream This class is designed to be used much like a ByteArrayOutputStream, the primary difference being that output is written to a temporary file as oppose to consuming memory with a byte array.
WTContext This class holds static state partitioned by applet or application instance.
WTMessage WTMessage is the wrapper class for getting a formatted, localized message, from a resource bundle.
WTProperties Windchill configuration properties.
WTStandardDateFormat WTStandardDateFormat
WTThread A thread that is associated with a WTContext and supports property change events.
 

Exception Summary
DebugStackTrace A debug utility for printing debug messages with a stack trace.
WTException WTException is the base class for Windchill exceptions.
WTInvalidParameterException WTInvalidParameterException extends the capability of the wt.util.WTRemoteException in that like the wt.util.WTException, it accommodates nested exceptions and localizable text messages.
WTIOException WTIOException extends the capability of the java.lang.IOException in that like the wt.util.WTException, it accommodates nested exceptions and localizable text messages.
WTPropertyVetoException WTPropertyVetoException extends the capability of the java.beans.PropertyVetoException in that like the wt.util.WTException, it accommodates nested exceptions and localizable text messages.
WTRemoteException WTRemoteException extends the capability of the java.lang.RemoteException in that like the wt.util.WTException, it accommodates nested exceptions and localizable text messages.
WTRuntimeException WTRuntimeException extends the capability of the java.lang.RuntimeException in that like the wt.util.WTException, it accommodates nested exceptions and localizable text messages.
 

Package wt.util Description

A treasure trove of utilities and standard objects that should be used:

and many others; this is a good place for a developer to browse.

Debug Capture Mechanism

Debug Class Model

Util Debug Model

 

Configuring Debug Capturing Properties

The file that contains the configuration information is Windchill\codebase\debug.properties.  The file contains descriptions for the syntax of entries and examples of each. The types of configuration entries are as follows:

Initializing a Class to use Debug Capturing

    public class SomeClass {
        public static final boolean DEBUG = DebugProperties.isDebugOn( CLASSNAME );
        private static final DebugWriter LOG = ( DEBUG ? DebugProperties.getWriter( CLASSNAME ) : null );
        ...

Capturing TRACE Information

    public void step1( String[] args ) {
        //##begin step1%3945723701D4.body preserve=yes
         if ( DEBUG && DebugProperties.isTrace( this ) ) {
             Object[] dargs = { args };
            LOG.enter( CLASSNAME, "step1(String[])", dargs );
         }
         step2()
         if ( DEBUG && DebugProperties.isTrace( this ) )
          LOG.exit( CLASSNAME , " step1(String[])" );
         //##end step1%3945723701D4.body
    }
    public boolean step2() {
        //##begin step2%3945729A030D.body preserve=yes
        if ( DEBUG&& DebugProperties.isTrace( this ) )
          LOG.enter( CLASSNAME, "step2()" );
        boolean retVal = step3( 3, this ) != null;
        if ( DEBUG && DebugProperties.isTrace( this ) )
          LOG.exit( CLASSNAME , "step2()", retVal );
        return retVal;
        //##end step2%3945729A030D.body
    }
    public Object step3( int primitive, Object object ) {
        //##begin step3%3945726A038A.body preserve=yes
        if ( DEBUG && DebugProperties.isTrace( this ) ) {
            Object[] dargs = { new Integer( primitive ), object };
           LOG.enter( CLASSNAME, "step3(int,Object)", dargs );
        }
        Object retVal = object;
        if ( DEBUG && DebugProperties.isTrace( this ) )
          LOG.exit( CLASSNAME, "step3(int,Object)", retVal );
        return retVal;
        //##end step3%3945726A038A.body
    }

Capturing Other Debug Information

    public void testData() {
        //##begin testData%39457382002E.body preserve=yes
        if ( DEBUG && DebugProperties.isData( this ) )
          LOG.identify( this ); // report the identity of an object
        if ( DEBUG && DebugProperties.isData( this ) )
          LOG.dump( this );  // report the complete state of an object
        //##end testData%39457382002E.body
    }

   public void testException() {

        //##begin testException%39457304035B.body preserve=yes
        Throwable thown = new WTRuntimeException( "Test brief runtime exception report" );
        if ( DEBUG && DebugProperties.isException( this ) )
          LOG.exception( thown );
        thown = new WTException( RESOURCE, wt.util.utilResource.MALFORMED_MIME, null );
        if ( DEBUG && DebugProperties.isException( this ) )
          LOG.exception( thown );
        //##end testException%39457304035B.body
    }

   public void testStackTrace() {

        //##begin testStackTrace%3945739F034B.body preserve=yes
        if ( DEBUG && DebugProperties.isStackTrace( this ) )
           LOG.printStackTrace( "Test printStackTrace" );
        //##end testStackTrace%3945739F034B.body
    }

   public void testReport() {

        //##begin testReport%394573880280.body preserve=yes
        if ( DEBUG && DebugProperties.isReport( this ) )
          LOG.report( "Test general report API." );
        //##end testReport%394573880280.body
    }

Adjusting Debug Configuration On The Fly

    public void setConfig1() {
 
        DebugProperties.setFlag( DebugFlag.TRACE, CLASSNAME, DebugType.CLASS, "", true );
    }

   public void setConfig2() {

 
        DebugProperties.setFlag( DebugFlag.DATA, CLASSNAME, DebugType.CLASS, "", true );
        DebugProperties.setFlag( DebugFlag.EXCEPTION, "wt.util", DebugType.PACKAGE, "", true );
        DebugProperties.setFlag( DebugFlag.REPORT, "wt.util", DebugType.PACKAGE_HIERARCHY, "", true );
        DebugProperties.setFlag( DebugFlag.STACK_TRACE, "<<subsystem>>util", DebugType.GROUP, "", true );
    }

 
    public void setConfig3() {    // set all flags on, with one call
        DebugProperties.setFlag( DebugFlag.ALL, CLASSNAME, DebugType.CLASS, "", true );
    }