Open Business Objects for EDI
v3.5.2

com.americancoders.util
Class Util

java.lang.Object
  extended bycom.americancoders.util.Util

public class Util
extends java.lang.Object

class of utility routines


Field Summary
static java.lang.String lineFeed
          line separator character used by local operating system.
 
Constructor Summary
Util()
           
 
Method Summary
static void closeOBOEProperty()
          use this if you need to reset the property file which is usually left open
static void copyFile(java.lang.String inputFile, java.lang.String outputFile)
          copy file using string file name
static java.lang.String currentDate()
           
static java.lang.String currentTime()
           
static void deepCopy(java.io.Externalizable fromObj, java.io.Externalizable toObj)
          returns a deep copy of an object
JavaWorld Javatip 76 by Dave Miller
http://www.javaworld.com/javaworld/javatips/jw-javatip76.html
static java.lang.String denormalizeNonUnicode(java.lang.String inString)
          normlizes the string to replace NonUnicode characters.
static java.lang.String getCES()
          gets and returns the x12 composite element seperator character
static java.lang.String getOBOEProperty(java.lang.String inString)
           
static boolean isInteger(java.lang.String arg)
           
static boolean isLog4JNotConfigured()
          Returns true if it appears that log4j have been previously configured.
static void main(java.lang.String[] args)
           
static java.lang.String normalize(java.lang.String inString)
          normlizes the string to remove XML characters.
static java.lang.String normalizeNonUnicode(java.lang.String inString)
          normlizes the string to remove NonUnicode characters.
static boolean propertyFileIndicatesDoPrevalidate()
          routine to test to see if we want to do the prevalidation logic
prevalidation is the function of segments to check to see if there valid by the first id code field in the container
static boolean propertyFileIndicatesThrowParsingException()
          routine to test to see if parsers should throw exceptions or based on property in OBOE.properties file "throwParsingException"
static boolean propertyFileIndicatesUseObject()
          routine to test to see if parsers allows try to use object files based on property in OBOE.properties file "useObject"
static java.io.Reader removeCRLFFromReader(java.io.Reader inReader)
          input blocked data.
static java.io.InputStream removeCRLFFromStream(java.io.InputStream inIS)
          input blocked data.
static java.lang.String rightTrim(java.lang.String inString)
          removes trailing spaces
static java.lang.String searchForFile(java.lang.String inFilename, java.lang.String inStopAtDir)
          starting with the full file name search down the specified absolute path to find the file
static void setOBOEProperty(java.lang.String inName, java.lang.String inValue)
           
static void setServletContextPath(java.lang.String inPath)
           
static java.lang.String unEscape(java.lang.String inString, java.lang.String inEscString)
          removes escape characters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lineFeed

public static final java.lang.String lineFeed
line separator character used by local operating system.

Constructor Detail

Util

public Util()
Method Detail

setServletContextPath

public static void setServletContextPath(java.lang.String inPath)

currentDate

public static java.lang.String currentDate()
Returns:
String date in format CCYYMMDD

currentTime

public static java.lang.String currentTime()
Returns:
String time in format HHMM 24hour

normalize

public static java.lang.String normalize(java.lang.String inString)
normlizes the string to remove XML characters.

Parameters:
inString - to be normalized
Returns:
String normalized

normalizeNonUnicode

public static java.lang.String normalizeNonUnicode(java.lang.String inString)
normlizes the string to remove NonUnicode characters.

Parameters:
inString - to be normalized
Returns:
String normalized

denormalizeNonUnicode

public static java.lang.String denormalizeNonUnicode(java.lang.String inString)
normlizes the string to replace NonUnicode characters.

Parameters:
inString - to be normalized
Returns:
String normalized

unEscape

public static java.lang.String unEscape(java.lang.String inString,
                                        java.lang.String inEscString)
removes escape characters

Parameters:
inString -
inEscString -
Returns:
String

searchForFile

public static java.lang.String searchForFile(java.lang.String inFilename,
                                             java.lang.String inStopAtDir)
starting with the full file name search down the specified absolute path to find the file

Parameters:
inFilename - - String, full path name for file
inStopAtDir - - String, stop looking after reaching this directory.
Returns:
String the file name found
Throws:
OBOEException - - file not found

propertyFileIndicatesThrowParsingException

public static boolean propertyFileIndicatesThrowParsingException()
routine to test to see if parsers should throw exceptions or based on property in OBOE.properties file "throwParsingException"

Returns:
boolean

propertyFileIndicatesDoPrevalidate

public static boolean propertyFileIndicatesDoPrevalidate()
routine to test to see if we want to do the prevalidation logic
prevalidation is the function of segments to check to see if there valid by the first id code field in the container

Returns:
boolean

copyFile

public static void copyFile(java.lang.String inputFile,
                            java.lang.String outputFile)
                     throws java.io.IOException
copy file using string file name

Parameters:
inputFile -
outputFile -
Throws:
java.io.IOException

propertyFileIndicatesUseObject

public static boolean propertyFileIndicatesUseObject()
routine to test to see if parsers allows try to use object files based on property in OBOE.properties file "useObject"

Returns:
boolean, default value is false

rightTrim

public static java.lang.String rightTrim(java.lang.String inString)
removes trailing spaces

Parameters:
inString -
Returns:
String

setOBOEProperty

public static void setOBOEProperty(java.lang.String inName,
                                   java.lang.String inValue)

getOBOEProperty

public static java.lang.String getOBOEProperty(java.lang.String inString)
                                        throws java.io.IOException
Throws:
java.io.IOException

closeOBOEProperty

public static void closeOBOEProperty()
use this if you need to reset the property file which is usually left open


getCES

public static java.lang.String getCES()
gets and returns the x12 composite element seperator character


removeCRLFFromStream

public static java.io.InputStream removeCRLFFromStream(java.io.InputStream inIS)
                                                throws java.io.IOException
input blocked data. returns it as a stream. data blocked by cr/lf.

Parameters:
inIS - InputStream object
Returns:
InputStream object
Throws:
java.io.IOException

removeCRLFFromReader

public static java.io.Reader removeCRLFFromReader(java.io.Reader inReader)
                                           throws java.io.IOException
input blocked data. returns it as a stream. data blocked by cr/lf.

Parameters:
inReader - Reader object
Returns:
Reader object
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)

isLog4JNotConfigured

public static boolean isLog4JNotConfigured()
Returns true if it appears that log4j have been previously configured. This code checks to see if there are any appenders defined for log4j which is the definitive way to tell if log4j is already initialized


deepCopy

public static void deepCopy(java.io.Externalizable fromObj,
                            java.io.Externalizable toObj)
returns a deep copy of an object
JavaWorld Javatip 76 by Dave Miller
http://www.javaworld.com/javaworld/javatips/jw-javatip76.html

Parameters:
fromObj -
toObj -

isInteger

public static boolean isInteger(java.lang.String arg)

Open Business Objects for EDI
v3.5.2


OBOE is a trademark or registered trademark of American Coders, Ltd. in the US and other countries.
Copyright 1999-2004 American Coders, Ltd.
POB 97462
Raleigh NC 27624 USA
All Rights Reserved.