本文整理汇总了Java中gnu.bytecode.ClassType类的典型用法代码示例。如果您正苦于以下问题:Java ClassType类的具体用法?Java ClassType怎么用?Java ClassType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClassType类属于gnu.bytecode包,在下文中一共展示了ClassType类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: compileToNode
import gnu.bytecode.ClassType; //导入依赖的package包/类
public void compileToNode(ApplyExp exp, Compilation comp,
ConsumerTarget target) {
CodeAttr code = comp.getCode();
Expression[] args = exp.getArgs();
args[0].compile(comp, Target.pushObject);
args[1].compile(comp, Target.pushObject);
String mname;
if (target.isContextTarget()) {
comp.loadCallContext();
mname = "applyTemplates$X";
} else {
code.emitLoad(target.getConsumerVariable());
mname = "applyTemplates$C";
}
code.emitInvokeStatic(ClassType.make("gnu.kawa.xslt.ApplyTemplates")
.getDeclaredMethod(mname, 3));
}
开发者ID:spurious,项目名称:kawa-mirror,代码行数:18,代码来源:ApplyTemplates.java
示例2: select
import gnu.bytecode.ClassType; //导入依赖的package包/类
public boolean select(Object value)
{
gnu.bytecode.Method method = (gnu.bytecode.Method) value;
String mname = method.getName();
int mmods = method.getModifiers();
if ((mmods & modmask) != modifiers
|| (mmods & Access.SYNTHETIC) != 0
|| ! mname.startsWith(name))
return false;
int mlen = mname.length();
char c;
if (mlen != nlen
&& (mlen != nlen + 2
|| mname.charAt(nlen) != '$'
|| ((c = mname.charAt(nlen+1)) != 'V' && c != 'X'))
&& (mlen != nlen + 4
|| ! mname.endsWith("$V$X")))
return false;
ClassType declaring = receiver instanceof ClassType ? (ClassType) receiver
: method.getDeclaringClass();
return caller == null
|| caller.isAccessible(declaring, receiver, method.getModifiers());
}
开发者ID:spurious,项目名称:kawa-mirror,代码行数:24,代码来源:ClassMethods.java
示例3: createReadTable
import gnu.bytecode.ClassType; //导入依赖的package包/类
public ReadTable createReadTable ()
{
ReadTable tab = ReadTable.createInitial();
tab.postfixLookupOperator = ':';
ReaderDispatch dispatchTable = (ReaderDispatch) tab.lookup('#');
dispatchTable.set('\'', new ReaderQuote(asSymbol("syntax")));
dispatchTable.set('`', new ReaderQuote(asSymbol("quasisyntax")));
dispatchTable.set(',', ReaderDispatchMisc.getInstance());
tab.putReaderCtorFld("path", "gnu.kawa.lispexpr.LangObjType", "pathType");
tab.putReaderCtorFld("filepath", "gnu.kawa.lispexpr.LangObjType", "filepathType");
tab.putReaderCtorFld("URI", "gnu.kawa.lispexpr.LangObjType", "URIType");
tab.putReaderCtor("symbol", ClassType.make("gnu.mapping.Symbol"));
tab.putReaderCtor("namespace", ClassType.make("gnu.mapping.Namespace"));
tab.putReaderCtorFld("duration", "kawa.lib.numbers", "duration");
tab.setFinalColonIsKeyword(true);
return tab;
}
开发者ID:mit-cml,项目名称:ai2-kawa,代码行数:18,代码来源:Scheme.java
示例4: getTypeMap
import gnu.bytecode.ClassType; //导入依赖的package包/类
@Override
protected synchronized HashMap<String, Type> getTypeMap() {
if (types == null) {
booleanType = new LangPrimType(Type.booleanType,
Scheme.getInstance());
types = new HashMap<String, Type>(128); // Bit more wiggle room
types.put("boolean", booleanType);
types.putAll(super.getTypeMap());
for (int i = uniformVectorTags.length; --i >= 0;) {
String tag = uniformVectorTags[i];
String cname = "gnu.lists." + tag.toUpperCase() + "Vector";
types.put(tag + "vector", ClassType.make(cname));
}
}
return types;
}
开发者ID:alain91,项目名称:kawa,代码行数:17,代码来源:Scheme.java
示例5: createReadTable
import gnu.bytecode.ClassType; //导入依赖的package包/类
public ReadTable createReadTable ()
{
ReadTable tab = ReadTable.createInitial();
int std = standardToFollow;
ReaderDispatch dispatchTable = (ReaderDispatch) tab.lookup('#');
ReaderDispatchSyntaxQuote sentry = new ReaderDispatchSyntaxQuote();
dispatchTable.set('\'', sentry);
dispatchTable.set('`', sentry);
dispatchTable.set(',', sentry);
tab.putReaderCtorFld("path", "gnu.kawa.lispexpr.LangObjType", "pathType");
tab.putReaderCtorFld("filepath", "gnu.kawa.lispexpr.LangObjType", "filepathType");
tab.putReaderCtorFld("URI", "gnu.kawa.lispexpr.LangObjType", "URIType");
tab.putReaderCtor("symbol", ClassType.make("gnu.mapping.Symbol"));
tab.putReaderCtor("namespace", ClassType.make("gnu.mapping.Namespace"));
tab.putReaderCtorFld("duration", "kawa.lib.numbers", "duration");
if (std == FOLLOW_R5RS || std == FOLLOW_R6RS || std == FOLLOW_R7RS)
{
}
else
{
tab.postfixLookupOperator = ':';
tab.setFinalColonIsKeyword(true);
}
return tab;
}
开发者ID:alain91,项目名称:kawa,代码行数:26,代码来源:Scheme.java
示例6: gnuByteCodeHelloWorld
import gnu.bytecode.ClassType; //导入依赖的package包/类
static byte[] gnuByteCodeHelloWorld() {
ClassType c = new ClassType("HelloWorld");
c.setSuper("java.lang.Object");
c.setModifiers(Access.PUBLIC);
c.setSourceFile("HelloWorld.java");
Method m = c.addMethod("<init>", "()V", Access.PUBLIC);
CodeAttr code = m.startCode();
code.pushScope();
code.emitPushThis();
code.emitInvokeSpecial(objectCtor);
code.emitReturn();
code.popScope();
m = c.addMethod("main", "([Ljava/lang/String;)V", Access.PUBLIC
| Access.STATIC);
code = m.startCode();
code.pushScope();
code.emitGetStatic(outField);
code.emitPushString("Hello world!");
code.emitInvokeVirtual(printlnMethod);
code.emitReturn();
code.popScope();
return c.writeToArray();
}
开发者ID:lrytz,项目名称:asm-legacy-svn-clone,代码行数:27,代码来源:GenPerfTest.java
示例7: getTypeMap
import gnu.bytecode.ClassType; //导入依赖的package包/类
@Override
protected synchronized HashMap<String, Type> getTypeMap() {
if (types == null) {
types = new HashMap<String, Type>(128); // Bit more wiggle room
types.put("boolean", booleanType);
types.put("parameter", Compilation.typeLocationProc);
types.putAll(super.getTypeMap());
for (int i = uniformVectorTags.length; --i >= 0;) {
String tag = uniformVectorTags[i];
String cname = "gnu.lists." + tag.toUpperCase() + "Vector";
types.put(tag + "vector", ClassType.make(cname));
}
}
return types;
}
开发者ID:spurious,项目名称:kawa-mirror,代码行数:16,代码来源:Scheme.java
示例8: createReadTable
import gnu.bytecode.ClassType; //导入依赖的package包/类
public ReadTable createReadTable ()
{
ReadTable tab = ReadTable.createInitial();
int std = standardToFollow;
ReaderDispatch dispatchTable = (ReaderDispatch) tab.lookup('#');
ReaderDispatchSyntaxQuote sentry = new ReaderDispatchSyntaxQuote();
dispatchTable.set('\'', sentry);
dispatchTable.set('`', sentry);
dispatchTable.set(',', sentry);
tab.putReaderCtorFld("path", "gnu.kawa.lispexpr.LangObjType", "pathType");
tab.putReaderCtorFld("filepath", "gnu.kawa.lispexpr.LangObjType", "filepathType");
tab.putReaderCtorFld("URI", "gnu.kawa.lispexpr.LangObjType", "URIType");
tab.putReaderCtor("symbol", ClassType.make("gnu.mapping.Symbol"));
tab.putReaderCtor("namespace", ClassType.make("gnu.mapping.Namespace"));
tab.putReaderCtorFld("duration", "kawa.lib.numbers", "duration");
if (std == FOLLOW_R5RS || std == FOLLOW_R6RS || std == FOLLOW_R7RS)
{
}
else
{
tab.postfixLookupOperator = ':';
tab.setFinalColonIsKeyword(true);
tab.extraFlags = LispReader.SCM_LEXPONENT_IS_BIGDECIMAL;
tab.set('@', new ReaderQuote(LispLanguage.splice_sym,
ReadTable.NON_TERMINATING_MACRO));
}
return tab;
}
开发者ID:spurious,项目名称:kawa-mirror,代码行数:29,代码来源:Scheme.java
示例9: writeExternal
import gnu.bytecode.ClassType; //导入依赖的package包/类
public void writeExternal(ObjectOutput out) throws IOException
{
String moduleClassName = null;
if (getOuter() instanceof ModuleExp) {
ClassType moduleClass = ((ModuleExp) getOuter()).getClassType();
if (moduleClass != null)
moduleClassName = moduleClass.getName();
}
out.writeObject(moduleClassName);
}
开发者ID:spurious,项目名称:kawa-mirror,代码行数:11,代码来源:TemplateScope.java
示例10: getInstance
import gnu.bytecode.ClassType; //导入依赖的package包/类
public static ClassNamespace getInstance (String name, ClassType ctype)
{
synchronized (nsTable)
{
Object old = nsTable.get(name);
if (old instanceof ClassNamespace)
return (ClassNamespace) old;
ClassNamespace ns = new ClassNamespace(ctype);
nsTable.put(name, ns);
return ns;
}
}
开发者ID:spurious,项目名称:kawa-mirror,代码行数:13,代码来源:ClassNamespace.java
示例11: MethodFilter
import gnu.bytecode.ClassType; //导入依赖的package包/类
public MethodFilter(String name, int modifiers, int modmask,
ClassType caller, ObjectType receiver)
{
this.name = name;
this.nlen = name.length();
this.modifiers = modifiers;
this.modmask = modmask;
this.caller = caller;
this.receiver = receiver;
}
开发者ID:spurious,项目名称:kawa-mirror,代码行数:11,代码来源:ClassMethods.java
示例12: make
import gnu.bytecode.ClassType; //导入依赖的package包/类
public static StaticFieldLocation make (Declaration decl)
{
gnu.bytecode.Field fld = decl.field;
ClassType ctype = fld.getDeclaringClass();
StaticFieldLocation loc = new StaticFieldLocation(ctype, fld.getName());
loc.setDeclaration(decl);
//maybe setKindFlags();
return loc;
}
开发者ID:spurious,项目名称:kawa-mirror,代码行数:10,代码来源:StaticFieldLocation.java
示例13: StaticGet
import gnu.bytecode.ClassType; //导入依赖的package包/类
public StaticGet (ClassType ctype, String name, Type ftype, int flags)
{
this.ctype = ctype;
this.fname = name;
field = ctype.getField(name);
if (field == null)
field = ctype.addField(name, ftype, flags);
}
开发者ID:spurious,项目名称:kawa-mirror,代码行数:9,代码来源:StaticGet.java
示例14: StaticSet
import gnu.bytecode.ClassType; //导入依赖的package包/类
public StaticSet (ClassType ctype, String name, Type ftype, int flags)
{
this.ctype = ctype;
this.fname = name;
field = ctype.getField(name);
if (field == null)
field = ctype.addField(name, ftype, flags);
}
开发者ID:spurious,项目名称:kawa-mirror,代码行数:9,代码来源:StaticSet.java
示例15: emitPushBoolean
import gnu.bytecode.ClassType; //导入依赖的package包/类
@Override
public void emitPushBoolean(boolean value)
{
CodeAttr code = getCode();
if (value)
code.emitGetStatic(ClassType.make("gnu.commonlisp.lang.Lisp2").getDeclaredField("TRUE"));
else
code.emitGetStatic(Compilation.scmListType.getDeclaredField("Empty"));
}
开发者ID:spurious,项目名称:kawa-mirror,代码行数:10,代码来源:Lisp2Compilation.java
示例16: find
import gnu.bytecode.ClassType; //导入依赖的package包/类
public synchronized ModuleInfo find (Compilation comp)
{
ModuleExp mexp = comp.getModule();
ClassType ctype = mexp.classFor(comp);
String fileName = mexp.getFileName();
Path sourceAbsPath = ModuleInfo.absPath(fileName);
ModuleInfo info = findWithSourcePath(sourceAbsPath, fileName);
info.setClassName(ctype.getName());
info.setCompilation(comp);
return info;
}
开发者ID:spurious,项目名称:kawa-mirror,代码行数:12,代码来源:ModuleManager.java
示例17: findWithClassName
import gnu.bytecode.ClassType; //导入依赖的package包/类
public ModuleInfo findWithClassName (String className)
{
ModuleInfo info = searchWithClassName(className);
if (info != null)
return info;
try
{
return findWithClass(ClassType.getContextClass(className));
}
catch (Exception ex)
{
throw WrappedException.wrapIfNeeded(ex);
}
}
开发者ID:spurious,项目名称:kawa-mirror,代码行数:15,代码来源:ModuleManager.java
示例18: createReDefinition
import gnu.bytecode.ClassType; //导入依赖的package包/类
private static ClassDefinition createReDefinition(File from){
try {
final byte[] bytes = Files.readAllBytes(from.toPath());
final ClassType type = ClassFileInput.readClassType(new ByteArrayInputStream(bytes));
final String name = type.getName();
Class clazz = Class.forName(name);
return new ClassDefinition(clazz, bytes);
} catch (Exception e) {
System.err.println("Failed to create definition for " + from.getAbsolutePath());
e.printStackTrace();
return null;
}
}
开发者ID:Darkyenus,项目名称:SBTHotswap,代码行数:14,代码来源:AgentMain.java
示例19: removeRedundantMethods
import gnu.bytecode.ClassType; //导入依赖的package包/类
private static int removeRedundantMethods(Vector methods)
{
// Remove over-ridden methods.
int mlength = methods.size();
loopi:
for (int i = 1; i < mlength; )
{
Method method1 = (Method) methods.elementAt(i);
ClassType class1 = method1.getDeclaringClass();
Type[] types1 = method1.getParameterTypes();
int tlen = types1.length;
for (int j = 0; j < i; j++)
{
Method method2 = (Method) methods.elementAt(j);
Type[] types2 = method2.getParameterTypes();
if (tlen != types2.length)
continue;
int k;
for (k = tlen; --k >= 0; )
{
if (types1[k] != types2[k])
break;
}
if (k >= 0)
continue;
if (class1.isSubtype(method2.getDeclaringClass()))
methods.setElementAt(method1, j);
methods.setElementAt(methods.elementAt(mlength - 1), i);
mlength--;
// Re-do current i, since methods[i] replaced.
continue loopi;
}
i++;
}
return mlength;
}
开发者ID:mit-cml,项目名称:ai2-kawa,代码行数:37,代码来源:ClassMethods.java
注:本文中的gnu.bytecode.ClassType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论