查找 Eclipse 编译的.class文件
问题:
我该如何只编译一个类?如何将其放入类文件(我已创建)中?Eclipse 不是在运行时自动编译所有类吗?
背景故事:
我正在学习一个教程,它告诉我:
将编译的类放入 WEB-INF/类中。
其中类是:
package org.odata4j.tomcat;
import java.util.Properties;
import org.core4j.Enumerable;
import org.core4j.Func;
import org.core4j.Funcs;
import org.odata4j.producer.ODataProducer;
import org.odata4j.producer.ODataProducerFactory;
import org.odata4j.producer.inmemory.InMemoryProducer;
public class ExampleProducerFactory implements ODataProducerFactory {
@Override
public ODataProducer create(Properties properties) {
InMemoryProducer producer = new InMemoryProducer("example");
// expose this jvm's thread information (Thread instances) as an entity-set called "Threads"
producer.register(Thread.class, Long.class, "Threads", new Func<Iterable<Thread>>() {
public Iterable<Thread> apply() {
ThreadGroup tg = Thread.currentThread().getThreadGroup();
while (tg.getParent() != null)
tg = tg.getParent();
Thread[] threads = new Thread[1000];
int count = tg.enumerate(threads, true);
return Enumerable.create(threads).take(count);
}
}, Funcs.method(Thread.class, Long.class, "getId"));
return producer;
}
}