Stellent
HowToComponents
JavaDoc

intradoc.common
Class ParseStringLocation

java.lang.Object
  |
  +--intradoc.common.ParseStringLocation

public class ParseStringLocation
extends java.lang.Object

Used for parsing numbers and dates. Note that this class "knows" about the possible objects it will parse and internal information about how those objects are formatted. Although this means that this class may have to be extended in the future with more constants or attributes, it allows a cleaner usage when actually parsing and reporting errors.


Field Summary
static short ERROR_EMPTY_STRING
           
static short ERROR_GENERAL
           
static short ERROR_INVALID_NUMBER
           
static short ERROR_NUMBER_NOT_IN_RANGE
           
static short ERROR_PATTERN_MISMATCH
           
static short ERROR_STRING_TOO_LONG
           
static short ERROR_SUCCESS
          Possible error codes.
static short ERROR_UNEXPECTED_STRING_END
           
static short ERROR_UNKNOWN_STRING
           
static short ERROR_UNSUPPORTED_FORMAT_SPECIFIER
           
 java.lang.Object m_activeParsingObject
          The current parsing object being used.
 java.lang.String m_elementLocation
          Element part location state.
 java.lang.String m_errMsg
          Error message.
 int m_errorIndex
          Error index, if different from regular index.
 java.util.Vector m_failedParsingLocations
          These are the ParseStringLocation objects that were used when the target object failed to parse under previous trials.
 int m_index
          Current offset into string where we are doing our processing.
 boolean m_indexIsErrorOffset
          Indicates whether index has meaning for error reports.
 java.lang.String m_objectPartLocation
          General object location state.
 int m_state
          Parsing error code.
 java.lang.String[] m_traceErrorStrings
          Trace strings for error codes.
 
Constructor Summary
ParseStringLocation()
           
ParseStringLocation(int index)
           
 
Method Summary
 void clearError()
           
 void copyErrorState(ParseStringLocation parseLocation)
           
 ParseStringLocation createRetryCopy()
           
 int determineErrorIndex()
           
 java.lang.String getFirstErrorMessage()
           
 ParseStringLocation getFirstParseError()
           
 java.lang.String getStateTraceString()
           
 void setErrorMessage(int index, int state, java.lang.String msg)
           
 void setErrorState(int index, int state)
           
 ParseStringLocation shallowClone()
           
 void shallowCopy(ParseStringLocation psl)
          Parameter has object data copied into it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR_SUCCESS

public static final short ERROR_SUCCESS
Possible error codes.

See Also:
Constant Field Values

ERROR_GENERAL

public static final short ERROR_GENERAL
See Also:
Constant Field Values

ERROR_PATTERN_MISMATCH

public static final short ERROR_PATTERN_MISMATCH
See Also:
Constant Field Values

ERROR_INVALID_NUMBER

public static final short ERROR_INVALID_NUMBER
See Also:
Constant Field Values

ERROR_NUMBER_NOT_IN_RANGE

public static final short ERROR_NUMBER_NOT_IN_RANGE
See Also:
Constant Field Values

ERROR_UNKNOWN_STRING

public static final short ERROR_UNKNOWN_STRING
See Also:
Constant Field Values

ERROR_UNSUPPORTED_FORMAT_SPECIFIER

public static final short ERROR_UNSUPPORTED_FORMAT_SPECIFIER
See Also:
Constant Field Values

ERROR_UNEXPECTED_STRING_END

public static final short ERROR_UNEXPECTED_STRING_END
See Also:
Constant Field Values

ERROR_EMPTY_STRING

public static final short ERROR_EMPTY_STRING
See Also:
Constant Field Values

ERROR_STRING_TOO_LONG

public static final short ERROR_STRING_TOO_LONG
See Also:
Constant Field Values

m_traceErrorStrings

public final java.lang.String[] m_traceErrorStrings
Trace strings for error codes.


m_index

public int m_index
Current offset into string where we are doing our processing.


m_errorIndex

public int m_errorIndex
Error index, if different from regular index. If negative, then this value is not set (use m_index to report error location).


m_indexIsErrorOffset

public boolean m_indexIsErrorOffset
Indicates whether index has meaning for error reports. Set to false if error applies to a process that includes multiple fields (such as conversion to milliseconds after all calendar fields have been parsed out).


m_errMsg

public java.lang.String m_errMsg
Error message. Use of this optional.


m_objectPartLocation

public java.lang.String m_objectPartLocation
General object location state. For dates indicates whether the parsing is in the date part or the time part. Otherwise this parameter will just indicate what type of object is being parsed.


m_elementLocation

public java.lang.String m_elementLocation
Element part location state. For the date part this might indicate the year, month, or day. In many cases if there are no subelements of a particular object part, then this value will be set to null.


m_activeParsingObject

public java.lang.Object m_activeParsingObject
The current parsing object being used. It is entirely optional for a particular parsing engine to use or not use this attribute.


m_failedParsingLocations

public java.util.Vector m_failedParsingLocations
These are the ParseStringLocation objects that were used when the target object failed to parse under previous trials. This attribute is not null only if there are alternate parsing objects that are using to parse a target string and at least one such alternate parsing object was tried after a failure using the primary parsing object.


m_state

public int m_state
Parsing error code. Indicates how the parsing failed.

Constructor Detail

ParseStringLocation

public ParseStringLocation()

ParseStringLocation

public ParseStringLocation(int index)
Method Detail

setErrorState

public void setErrorState(int index,
                          int state)

setErrorMessage

public void setErrorMessage(int index,
                            int state,
                            java.lang.String msg)

copyErrorState

public void copyErrorState(ParseStringLocation parseLocation)

determineErrorIndex

public int determineErrorIndex()

clearError

public void clearError()

getFirstParseError

public ParseStringLocation getFirstParseError()

getFirstErrorMessage

public java.lang.String getFirstErrorMessage()

shallowClone

public ParseStringLocation shallowClone()

shallowCopy

public void shallowCopy(ParseStringLocation psl)
Parameter has object data copied into it.


createRetryCopy

public ParseStringLocation createRetryCopy()

getStateTraceString

public java.lang.String getStateTraceString()


(c) 1996-2005  All rights reserved.  Stellent, Inc.