关于javaatd的信息
今天给各位分享javaatd的知识,其中也会对进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
- 1、java语义分析
- 2、javac 引入包问题
- 3、Cannot complete the install because one or more required items could
- 4、用java做一个java登录监控程序,监控当前有多少个session有效,急~~~~
- 5、java script 遇到的动态添加 ie浏览器不支持 别的都可以 问题出在哪? ie具体不支持我写的哪些关键字?
java语义分析
public class VariableTypeResolver {
private final String symbol;
private final ASTNode minScope;
private boolean methodLevel = true;
private boolean typeLevel = true;
/**
* The found result
*/
private SimpleName declSN;
private final ASTVisitor visitor = new ASTVisitor() {
@Override
public boolean visit(SimpleName sn) {
if (found()) {
return false;
}
if (sn.getIdentifier().equals(symbol) sn.getParent() instanceof VariableDeclaration) {
declSN = sn;
return false;
}
return true;
}
};
/**
* Starts resolving with the requested symbol
* @param varSymbolNode the variable symbol node to resolve (node must be in the AST)
*/
public VariableTypeResolver(SimpleName varSymbolNode) {
this.symbol = varSymbolNode.getIdentifier();
this.minScope = varSymbolNode;
}
public VariableTypeResolver(String varSymbol, ASTNode minScope) {
this.symbol = varSymbol;
this.minScope = minScope;
}
public VariableTypeResolver disableMethodLevel() {
methodLevel = false;
return this;
}
public VariableTypeResolver disableTypeLevel() {
typeLevel = false;
return this;
}
/**
* Node's parent is instance of {@link VariableDeclarationFragment} or {@link SingleVariableDeclaration}
* @return the SimpleName node of declaration
*/
public SimpleName resolveDeclSimpleName() {
if (!found()) {
resolve();
}
return declSN;
}
private void resolve() {
if(found()) {return;}
if (methodLevel) {
apply(FindUpper.methodScope(minScope));
}
if(found()) {return;}
if (typeLevel) {
AbstractTypeDeclaration typeScope = FindUpper.abstractTypeScope(minScope);
applyInFields(typeScope);
if(found()) {return;}
for (TypeDeclaration superClass : superClasses(typeScope)) {
if(found()) {return;}
applyInFields(superClass);
}
}
}
private boolean found() {
return declSN != null;
}
private void apply(ASTNode scope) {
if (scope == null) {
throw new NullPointerException();
}
scope.accept(visitor);
}
private void applyInFields(AbstractTypeDeclaration typeScope) {
for (Object bd : typeScope.bodyDeclarations()) {
if (bd instanceof FieldDeclaration) {
apply((ASTNode) bd);
}
}
}
private ListTypeDeclaration superClasses(AbstractTypeDeclaration atd) {
if (atd instanceof TypeDeclaration) {
return AstUtils.superClasses((TypeDeclaration) atd);
}
else {
return Collections.EMPTY_LIST;
}
}
}
也是网上找的
javac 引入包问题
如果你的类都在一个文件夹下,那么这么写
javac -classpath c:\xxx\B.jar, c:\xxx\C.jar *.java
如果要处理大量的依赖关系,最好用eclipse,要么用ant自己写。
Cannot complete the install because one or more required items could
你将ADT解压出来看看,看你上面的那几个包,在解压出来后的ADT中是否能找到,想你出现这种情况,一般来说你是在解压出来的ADT中是找不到的,我当初也出现过这样的问题,发现ADT中没有上面指出的那几个包,后来换了个新版本的ADT,问题就解决了,或者你直接在线跟新ADT也行
用java做一个java登录监控程序,监控当前有多少个session有效,急~~~~
自定义一个SESSION的监听类就行
public class SessionListener implements HttpSessionAttributeListener {
private static HashMap _U = new HashMap();
public static HashMap get_U() {
return _U;
}
/**
* 返回在线用户数量
* @return
*/
public static int size(){
return get_U().size();
}
public static void set_U(HashMap _u) {
_U = _u;
}
public void attributeAdded(HttpSessionBindingEvent event) {
if(event.getName().equals("Account")){
_U.put(event.getValue(),new Timestamp(System.currentTimeMillis()));
}
}
public void attributeRemoved(HttpSessionBindingEvent event) {
if(event.getName().equals("Account")){
_U.remove(event.getValue());
}
}
public static float getOnlineHour(Timestamp tsp){
return AtdUtil.marginMin(tsp,new Timestamp(System.currentTimeMillis()));
}
public void attributeReplaced(HttpSessionBindingEvent event) {
}
}
java script 遇到的动态添加 ie浏览器不支持 别的都可以 问题出在哪? ie具体不支持我写的哪些关键字?
IE的版本不同,会有不同的问题的。。。。。。添加alert 来慢慢调试
这样的添加方式较好
var tbl = document.getElementById("two");
var row = tbl.insertRow();
var cell=row.insertCell();
cell.innerHTML = "hello world";
关于javaatd和的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。