dk.brics.xact.analysis
Enum ErrorType

java.lang.Object
  extended by java.lang.Enum<ErrorType>
      extended by dk.brics.xact.analysis.ErrorType
All Implemented Interfaces:
Serializable, Comparable<ErrorType>

public enum ErrorType
extends Enum<ErrorType>


Enum Constant Summary
DISCARDED_RESULT
          An operation like plug was used without using the result for anything, which is a typical bug pattern.
EMPTY_RESULT
          An XPath expression always returned an empty result.
INVALID
          An XML fragment might not satisfy the XML type it was expected to.
INVALID_PLUG_TYPE
          A plug or close operation might violate the type restriction on a gap
MALFORMED_XML_CONSTANT
          An XML constant in the program was malformed.
MISSING_GAP
          A plug operation had no effect because the specified gap is absent.
NOT_UNIQUE_ROOT
          XML.toDocument() was called on something that might not be well-formed because it did not have a unique root element.
OTHER
           
TEST_FAILS
          An XPath boolean test is always false.
UNSUPPORTED_OPERATION
          An operation from the runtime system that the analysis can not yet handle was used.
XML_IN_ATTRIBUTE
          A gap might be plugged with XML data.
 
Method Summary
 String getMessage()
          Returns a short human-readable description of this error type.
 boolean isDefinite()
          Returns true if an error of this type denotes something that will definitely be the case at runtime.
static ErrorType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ErrorType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DISCARDED_RESULT

public static final ErrorType DISCARDED_RESULT
An operation like plug was used without using the result for anything, which is a typical bug pattern.
 x.plug(..); // reports warning
 x = x.plug(..); // this is probably the programmer meant
 


EMPTY_RESULT

public static final ErrorType EMPTY_RESULT
An XPath expression always returned an empty result.


INVALID

public static final ErrorType INVALID
An XML fragment might not satisfy the XML type it was expected to.


INVALID_PLUG_TYPE

public static final ErrorType INVALID_PLUG_TYPE
A plug or close operation might violate the type restriction on a gap


MALFORMED_XML_CONSTANT

public static final ErrorType MALFORMED_XML_CONSTANT
An XML constant in the program was malformed.


MISSING_GAP

public static final ErrorType MISSING_GAP
A plug operation had no effect because the specified gap is absent.


NOT_UNIQUE_ROOT

public static final ErrorType NOT_UNIQUE_ROOT
XML.toDocument() was called on something that might not be well-formed because it did not have a unique root element.


OTHER

public static final ErrorType OTHER

TEST_FAILS

public static final ErrorType TEST_FAILS
An XPath boolean test is always false.


UNSUPPORTED_OPERATION

public static final ErrorType UNSUPPORTED_OPERATION
An operation from the runtime system that the analysis can not yet handle was used.


XML_IN_ATTRIBUTE

public static final ErrorType XML_IN_ATTRIBUTE
A gap might be plugged with XML data.

Method Detail

getMessage

public String getMessage()
Returns a short human-readable description of this error type.

Returns:
a short human-readable string

isDefinite

public boolean isDefinite()
Returns true if an error of this type denotes something that will definitely be the case at runtime. In other words, definite errors should only be reported if the analysis finds that there definitely is a problem, while non-definite errors should be reported if the analysis simply fails to prove that there never is a problem.

For example, EMPTY_RESULT is definite because the result will definitely be empty every time at runtime. An error like INVALID is not definite because the XML may not be invalid every time during runtime, or may not even be invalid at all, but was reported because the analysis failed to prove otherwise.

Talk of soundness usually only makes sense for the non-definite error types, but informally one can say that it is wrong to report a definite error if there is not actually such an error.

Returns:
true if this error type is definite; false otherwise

valueOf

public static ErrorType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

values

public static ErrorType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ErrorType c : ErrorType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared


Copyright © 2005-2011 Aarhus University.