?? httpmethod.java
字號:
/**
*
*/
package edu.sysu.http.impl;
import edu.sysu.http.util.HttpGrammarException;
import edu.sysu.http.util.HttpRegex;
/**
* @author Administrator
*
*/
public class HttpMethod {
private String method;
private HttpRegex regex = new HttpRegex();
/**
*
*/
public HttpMethod() {
// TODO Auto-generated constructor stub
this.regex.SetPattern("GET|HEAD|POST");
}
public HttpMethod(String method) throws HttpGrammarException{
this();
this.setMethod(method);
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
}
/**
* @param method the method to set
*/
public void setMethod(String method) throws HttpGrammarException{
if(this.regex.Match(method))
this.method = method;
else
throw new HttpGrammarException("Method-name invalid.");
}
/**
* @return the method
*/
public String getMethod() {
return method;
}
public String toString(){
return this.method;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -