FileDocCategorySizeDatePackage
ErrorMsg.javaAPI DocJava SE 5 API12719Fri Aug 26 14:55:38 BST 2005com.sun.org.apache.xalan.internal.xsltc.compiler.util

ErrorMsg

public final class ErrorMsg extends Object
author
Jacek Ambroziak
author
Santiago Pericas-Geertsen
author
G. Todd Miller
author
Erwin Bolwidt
author
Morten Jorgensen

Fields Summary
private String
_code
private int
_line
private String
_message
private String
_url
Object[]
_params
public static final String
MULTIPLE_STYLESHEET_ERR
public static final String
TEMPLATE_REDEF_ERR
public static final String
TEMPLATE_UNDEF_ERR
public static final String
VARIABLE_REDEF_ERR
public static final String
VARIABLE_UNDEF_ERR
public static final String
CLASS_NOT_FOUND_ERR
public static final String
METHOD_NOT_FOUND_ERR
public static final String
ARGUMENT_CONVERSION_ERR
public static final String
FILE_NOT_FOUND_ERR
public static final String
INVALID_URI_ERR
public static final String
FILE_ACCESS_ERR
public static final String
MISSING_ROOT_ERR
public static final String
NAMESPACE_UNDEF_ERR
public static final String
FUNCTION_RESOLVE_ERR
public static final String
NEED_LITERAL_ERR
public static final String
XPATH_PARSER_ERR
public static final String
REQUIRED_ATTR_ERR
public static final String
ILLEGAL_CHAR_ERR
public static final String
ILLEGAL_PI_ERR
public static final String
STRAY_ATTRIBUTE_ERR
public static final String
ILLEGAL_ATTRIBUTE_ERR
public static final String
CIRCULAR_INCLUDE_ERR
public static final String
RESULT_TREE_SORT_ERR
public static final String
SYMBOLS_REDEF_ERR
public static final String
XSL_VERSION_ERR
public static final String
CIRCULAR_VARIABLE_ERR
public static final String
ILLEGAL_BINARY_OP_ERR
public static final String
ILLEGAL_ARG_ERR
public static final String
DOCUMENT_ARG_ERR
public static final String
MISSING_WHEN_ERR
public static final String
MULTIPLE_OTHERWISE_ERR
public static final String
STRAY_OTHERWISE_ERR
public static final String
STRAY_WHEN_ERR
public static final String
WHEN_ELEMENT_ERR
public static final String
UNNAMED_ATTRIBSET_ERR
public static final String
ILLEGAL_CHILD_ERR
public static final String
ILLEGAL_ELEM_NAME_ERR
public static final String
ILLEGAL_ATTR_NAME_ERR
public static final String
ILLEGAL_TEXT_NODE_ERR
public static final String
SAX_PARSER_CONFIG_ERR
public static final String
INTERNAL_ERR
public static final String
UNSUPPORTED_XSL_ERR
public static final String
UNSUPPORTED_EXT_ERR
public static final String
MISSING_XSLT_URI_ERR
public static final String
MISSING_XSLT_TARGET_ERR
public static final String
NOT_IMPLEMENTED_ERR
public static final String
NOT_STYLESHEET_ERR
public static final String
ELEMENT_PARSE_ERR
public static final String
KEY_USE_ATTR_ERR
public static final String
OUTPUT_VERSION_ERR
public static final String
ILLEGAL_RELAT_OP_ERR
public static final String
ATTRIBSET_UNDEF_ERR
public static final String
ATTR_VAL_TEMPLATE_ERR
public static final String
UNKNOWN_SIG_TYPE_ERR
public static final String
DATA_CONVERSION_ERR
public static final String
NO_TRANSLET_CLASS_ERR
public static final String
NO_MAIN_TRANSLET_ERR
public static final String
TRANSLET_CLASS_ERR
public static final String
TRANSLET_OBJECT_ERR
public static final String
ERROR_LISTENER_NULL_ERR
public static final String
JAXP_UNKNOWN_SOURCE_ERR
public static final String
JAXP_NO_SOURCE_ERR
public static final String
JAXP_COMPILE_ERR
public static final String
JAXP_INVALID_ATTR_ERR
public static final String
JAXP_SET_RESULT_ERR
public static final String
JAXP_NO_TRANSLET_ERR
public static final String
JAXP_NO_HANDLER_ERR
public static final String
JAXP_NO_RESULT_ERR
public static final String
JAXP_UNKNOWN_PROP_ERR
public static final String
SAX2DOM_ADAPTER_ERR
public static final String
XSLTC_SOURCE_ERR
public static final String
ER_RESULT_NULL
public static final String
JAXP_INVALID_SET_PARAM_VALUE
public static final String
COMPILE_STDIN_ERR
public static final String
COMPILE_USAGE_STR
public static final String
TRANSFORM_USAGE_STR
public static final String
STRAY_SORT_ERR
public static final String
UNSUPPORTED_ENCODING
public static final String
SYNTAX_ERR
public static final String
CONSTRUCTOR_NOT_FOUND
public static final String
NO_JAVA_FUNCT_THIS_REF
public static final String
TYPE_CHECK_ERR
public static final String
TYPE_CHECK_UNK_LOC_ERR
public static final String
ILLEGAL_CMDLINE_OPTION_ERR
public static final String
CMDLINE_OPT_MISSING_ARG_ERR
public static final String
WARNING_PLUS_WRAPPED_MSG
public static final String
WARNING_MSG
public static final String
FATAL_ERR_PLUS_WRAPPED_MSG
public static final String
FATAL_ERR_MSG
public static final String
ERROR_PLUS_WRAPPED_MSG
public static final String
ERROR_MSG
public static final String
TRANSFORM_WITH_TRANSLET_STR
public static final String
TRANSFORM_WITH_JAR_STR
public static final String
COULD_NOT_CREATE_TRANS_FACT
public static final String
TRANSLET_NAME_JAVA_CONFLICT
public static final String
INVALID_QNAME_ERR
public static final String
INVALID_NCNAME_ERR
public static final String
INVALID_METHOD_IN_OUTPUT
private static ResourceBundle
_bundle
public static final String
ERROR_MESSAGES_KEY
public static final String
COMPILER_ERROR_KEY
public static final String
COMPILER_WARNING_KEY
public static final String
RUNTIME_ERROR_KEY
Constructors Summary
public ErrorMsg(String code)


     
        _bundle = ResourceBundle.getBundle(
                          "com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMessages",
                          Locale.getDefault());
    
	_code = code;
	_line = 0;
    
public ErrorMsg(Throwable e)

   	_code = null;
	_message = e.getMessage();
	_line = 0;
    
public ErrorMsg(String message, int line)

	_code = null;
	_message = message;
	_line = line;
    
public ErrorMsg(String code, int line, Object param)

	_code = code;
	_line = line;
	_params = new Object[] { param };
    
public ErrorMsg(String code, Object param)

	this(code);
	_params = new Object[1];
	_params[0] = param;
    
public ErrorMsg(String code, Object param1, Object param2)

	this(code);
	_params = new Object[2];
	_params[0] = param1;
	_params[1] = param2;
    
public ErrorMsg(String code, SyntaxTreeNode node)

	_code = code;
	_url  = getFileName(node);
	_line = node.getLineNumber();
    
public ErrorMsg(String code, Object param1, SyntaxTreeNode node)

	_code = code;
	_url  = getFileName(node);
	_line = node.getLineNumber();
	_params = new Object[1];
	_params[0] = param1;
    
public ErrorMsg(String code, Object param1, Object param2, SyntaxTreeNode node)

	_code = code;
	_url  = getFileName(node);
	_line = node.getLineNumber();
	_params = new Object[2];
	_params[0] = param1;
	_params[1] = param2;
    
Methods Summary
private java.lang.StringformatLine()

	StringBuffer result = new StringBuffer();
	if (_url != null) {
	    result.append(_url);
	    result.append(": ");
	}
	if (_line > 0) {
	    result.append("line ");
	    result.append(Integer.toString(_line));
	    result.append(": ");
	}
	return result.toString();
    
private java.lang.StringgetErrorMessage()
Return an ErrorMessages string corresponding to the _code This function is temporary until the three special-cased keys below are moved into ErrorMessages

return
ErrorMessages string

      return _bundle.getString(_code);
    
private java.lang.StringgetFileName(com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode node)

	Stylesheet stylesheet = node.getStylesheet();
	if (stylesheet != null)
	    return stylesheet.getSystemId();
	else
	    return null;
    
public java.lang.StringtoString()
This version of toString() uses the _params instance variable to format the message. If the _code is negative the use _message as the error string.

	String suffix = (_params == null) ? 
	    (null != _code ? new String(getErrorMessage()) : _message)
	    : MessageFormat.format(getErrorMessage(), _params);
	return formatLine() + suffix;
    
public java.lang.StringtoString(java.lang.Object obj)

	Object params[] = new Object[1];
	params[0] = obj.toString();
	String suffix = MessageFormat.format(getErrorMessage(), params);
	return formatLine() + suffix;
    
public java.lang.StringtoString(java.lang.Object obj0, java.lang.Object obj1)

	Object params[] = new Object[2];
	params[0] = obj0.toString();
	params[1] = obj1.toString();
	String suffix = MessageFormat.format(getErrorMessage(), params);
	return formatLine() + suffix;