📄 token.java
字号:
ATTRIBUTE_START_TOKEN.put(new Integer(0x55), new String[]{ "id", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x15), new String[]{ "ivalue", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x16), new String[]{ "iname", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x18), new String[]{ "label", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x19), new String[]{ "localsrc", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x1A), new String[]{ "maxlength", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x1B), new String[]{ "method", "get"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x1C), new String[]{ "method", "post"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x1D), new String[]{ "mode", "nowrap"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x1E), new String[]{ "mode", "wrap"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x1F), new String[]{ "multiple", "false"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x20), new String[]{ "multiple", "true"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x21), new String[]{ "name", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x22), new String[]{ "newcontext", "false"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x23), new String[]{ "newcontext", "true"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x25), new String[]{ "onenterbackward", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x26), new String[]{ "onenterforward", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x24), new String[]{ "onpick", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x27), new String[]{ "ontimer", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x28), new String[]{ "optional", "false"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x29), new String[]{ "optional", "true"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x2A), new String[]{ "path", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x2E), new String[]{ "scheme", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x2F), new String[]{ "sendreferer", "false"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x30), new String[]{ "sendreferer", "true"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x31), new String[]{ "size", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x32), new String[]{ "src", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x58), new String[]{ "src", "http://"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x59), new String[]{ "src", "https://"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x33), new String[]{ "ordered", "true"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x34), new String[]{ "ordered", "false"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x35), new String[]{ "tabindex", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x36), new String[]{ "title", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x37), new String[]{ "type", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x38), new String[]{ "type", "accept"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x39), new String[]{ "type", "delete"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x3a), new String[]{ "type", "help"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x3b), new String[]{ "type", "password"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x3c), new String[]{ "type", "onpick"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x3d), new String[]{ "type", "onenterbackward"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x3e), new String[]{ "type", "onenterforward"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x3f), new String[]{ "type", "ontimer"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x45), new String[]{ "type", "options"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x46), new String[]{ "type", "prev"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x47), new String[]{ "type", "reset"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x48), new String[]{ "type", "text"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x49), new String[]{ "type", "vnd."});
ATTRIBUTE_START_TOKEN.put(new Integer(0x4d), new String[]{ "value", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x4e), new String[]{ "vspace", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x4f), new String[]{ "width", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x50), new String[]{ "xml:lang", ""});
ATTRIBUTE_START_TOKEN.put(new Integer(0x62), new String[]{ "xml:space", "preserve"});
ATTRIBUTE_START_TOKEN.put(new Integer(0x63), new String[]{ "xml:space", "default"});
}
static void initAttributeValueToken()
{
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x85), ".com/");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x86), ".edu/");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x87), ".net/");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x88), ".org/");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x89), "accept");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x8A), "bottom");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x8B), "clear");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x8C), "delete");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x8D), "help");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x8E), "http://");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x8F), "http://www.");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x90), "https://");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x91), "https://www.");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x93), "middle");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x94), "nowrap");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x96), "onenterbackward");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x97), "onenterforward");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x95), "onpick");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x98), "ontimer");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x99), "options");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x9A), "password");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x9B), "reset");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x9D), "text");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x9E), "top");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0x9F), "unknown");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0xA0), "wrap");
ATTRIBUTE_VALUE_TOKEN.put(new Integer(0xA1), "Www.");
}
/**
* 从Attribute Start Token里查Attribute Label
* @param b
* @return
*/
static String getAttLabelFromAttStartToken(int b)
{
//#ifdef debug
//# System.out.println("getAttLabelFromAttStartToken -> " + b);
//#endif
Object value = ATTRIBUTE_START_TOKEN.get(new Integer(b));
if(value == null)
{
return null;
}
String[] att = (String[]) value;
return att[0]; // index 0 == attLabel
}
/**
* 从Attribute Start Token里查Attribute Value
* @param b
* @return
*/
static String getAttValueFromAttStartToken(int b)
{
//#ifdef debug
//# System.out.println("getAttValueFromAttStartToken -> " + b);
//#endif
Object value = ATTRIBUTE_START_TOKEN.get(new Integer(b));
if(value == null)
{
return null;
}
String[] att = (String[]) value;
return att[1]; // index 1 == attValue
}
/**
* 从Attribute Value Token里查值
*/
static String getValueFromAttValueToken(int b)
{
//#ifdef debug
//# System.out.println("getValueFromAttValueToken -> " + b);
//#endif
Object value = ATTRIBUTE_VALUE_TOKEN.get(new Integer(b));
if(value == null)
{
return null;
}
String attValue = (String) value;
return attValue; // index 1 == attValue
}
/**
* 返回不需要处理的Global Token, 由后面处理
* @param b
* @return
*/
static boolean isGlobalTokenNotNeedHandle(int b)
{
int ib = b;
switch(ib)
{
case Token.GLOBAL_END:
return false;
default:
return true;
}
}
/**
* 是否后面有follow的globalToken
* @param b
* @return
*/
static boolean isGlobalToken(int b)
{
int ib = b;
for(int i = 0 ; i < Token.GLOBAL_TOKEN.length ; i ++)
{
if(ib == Token.GLOBAL_TOKEN[i])
{
return true;
}
}
return false;
}
/**
* 是否后面有follow的globalToken
* @param b
* @return
*/
static boolean isGlobalTokenNeedHandle(int b)
{
int ib = b;
if(!isGlobalToken(b))
{
return false;
}
switch(ib)
{
case Token.GLOBAL_SWITCH_PAGE:
case Token.GLOBAL_END:
case Token.GLOBAL_PI:
case Token.GLOBAL_LITERAL_C:
case Token.GLOBAL_LITERAL_A:
case Token.GLOBAL_EXT_0:
case Token.GLOBAL_EXT_1:
case Token.GLOBAL_EXT_2:
case Token.GLOBAL_OPAQUE:
case Token.GLOBAL_LITERAL_AC:
return false;
default:
return true;
}
}
/**
* 得到TagToken的值(Name)
* @param b
* @return
*/
static String getTagName(int b)
{
Object value = TAG_TOKEN.get(new Integer(b));
if(value == null)
{
return null;
}
String tagName = (String) value;
return tagName; // index 1 == attValue
}
static String getCharset(int charset)
{
switch(charset)
{
case IANA_UTF_8:
return UTF_8;
case IANA_UTF_16:
return UTF_16;
// case IANA_UTF_32:
// return UTF_32;
case IANA_GBK:
return GBK;
}
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -