本文整理汇总了Java中com.sun.jdi.InterfaceType类的典型用法代码示例。如果您正苦于以下问题:Java InterfaceType类的具体用法?Java InterfaceType怎么用?Java InterfaceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InterfaceType类属于com.sun.jdi包,在下文中一共展示了InterfaceType类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: allMethods
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
/**
* Shared implementation of {@linkplain ClassType#allMethods()} and
* {@linkplain InterfaceType#allMethods()}
* @return A list of all methods (recursively)
*/
public final List<Method> allMethods() {
ArrayList<Method> list = new ArrayList<>(methods());
ClassType clazz = superclass();
while (clazz != null) {
list.addAll(clazz.methods());
clazz = clazz.superclass();
}
/*
* Avoid duplicate checking on each method by iterating through
* duplicate-free allInterfaces() rather than recursing
*/
for (InterfaceType interfaze : getAllInterfaces()) {
list.addAll(interfaze.methods());
}
return list;
}
开发者ID:campolake,项目名称:openjdk9,代码行数:22,代码来源:InvokableTypeImpl.java
示例2: isF3Type
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
/**
* JDI addition: Determines if this is a F3 class.
*
* @return <code>true</code> if this is a F3 class; false otherwise.
*/
@Override
public boolean isF3Type() {
if (!isIsF3TypeSet) {
isIsF3TypeSet = true;
F3VirtualMachine f3vm = virtualMachine();
InterfaceType f3ObjType = (InterfaceType) F3Wrapper.unwrap(f3vm.f3ObjectType());
if (f3ObjType != null) {
ClassType thisType = underlying();
List<InterfaceType> allIfaces = thisType.allInterfaces();
for (InterfaceType iface : allIfaces) {
if (iface.equals(f3ObjType)) {
isF3Type = true;
break;
}
}
}
}
return isF3Type;
}
开发者ID:unktomi,项目名称:form-follows-function,代码行数:25,代码来源:F3ClassType.java
示例3: isAssignableTo
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
@Override
boolean isAssignableTo(ReferenceType type) {
ClassTypeImpl superclazz = (ClassTypeImpl) superclass();
if (this.equals(type)) {
return true;
} else if ((superclazz != null) && superclazz.isAssignableTo(type)) {
return true;
} else {
List<InterfaceType> interfaces = interfaces();
Iterator<InterfaceType> iter = interfaces.iterator();
while (iter.hasNext()) {
InterfaceTypeImpl interfaze = (InterfaceTypeImpl) iter.next();
if (interfaze.isAssignableTo(type)) {
return true;
}
}
return false;
}
}
开发者ID:frohoff,项目名称:jdk8u-dev-jdk,代码行数:20,代码来源:InvokableTypeImpl.java
示例4: handleInterfaceLoad
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
private void handleInterfaceLoad(final InterfaceType intfType, final ThreadReference thread)
{
// do not proceed if this part of the hierarchy has been processed
if (contourFactory().lookupStaticContour(intfType.name()) == null)
{
// update the meta-data for this type and all other types in its file
resolveType(intfType);
// recursively create the schemas, as necessary
final List<?> superTypes = intfType.superinterfaces();
for (final Object o : superTypes)
{
final InterfaceType superType = (InterfaceType) o;
handleInterfaceLoad(superType, thread);
}
// all interfaces are either top-level or static;
// we only create a contour if the interface declares fields
if (intfType.fields().size() > 0)
{
// creates and dispatches a type load event for this type
manager().jiveDispatcher().dispatchLoadEvent(intfType, thread);
}
}
}
开发者ID:UBPL,项目名称:jive,代码行数:24,代码来源:JDIEventHandlerDelegate.java
示例5: addVisibleMethods
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
@Override
final void addVisibleMethods(Map<String, Method> methodMap, Set<InterfaceType> seenInterfaces) {
/*
* Add methods from
* parent types first, so that the methods in this class will
* overwrite them in the hash table
*/
Iterator<InterfaceType> iter = interfaces().iterator();
while (iter.hasNext()) {
InterfaceTypeImpl interfaze = (InterfaceTypeImpl) iter.next();
if (!seenInterfaces.contains(interfaze)) {
interfaze.addVisibleMethods(methodMap, seenInterfaces);
seenInterfaces.add(interfaze);
}
}
ClassTypeImpl clazz = (ClassTypeImpl) superclass();
if (clazz != null) {
clazz.addVisibleMethods(methodMap, seenInterfaces);
}
addToMethodMap(methodMap, methods());
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:InvokableTypeImpl.java
示例6: writeLocation
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
void writeLocation(Location location) {
ReferenceTypeImpl refType = (ReferenceTypeImpl)location.declaringType();
byte tag;
if (refType instanceof ClassType) {
tag = JDWP.TypeTag.CLASS;
} else if (refType instanceof InterfaceType) {
// It's possible to have executable code in an interface
tag = JDWP.TypeTag.INTERFACE;
} else {
throw new InternalException("Invalid Location");
}
writeByte(tag);
writeClassRef(refType.ref());
writeMethodRef(((MethodImpl)location.method()).ref());
writeLong(location.codeIndex());
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:PacketStream.java
示例7: visibleMethods
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
public List<Method> visibleMethods() {
/*
* Build a collection of all visible methods. The hash
* map allows us to do this efficiently by keying on the
* concatenation of name and signature.
*/
Map<String, Method> map = new HashMap<String, Method>();
addVisibleMethods(map, new HashSet<InterfaceType>());
/*
* ... but the hash map destroys order. Methods should be
* returned in a sensible order, as they are in allMethods().
* So, start over with allMethods() and use the hash map
* to filter that ordered collection.
*/
List<Method> list = allMethods();
list.retainAll(new HashSet<Method>(map.values()));
return list;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:ReferenceTypeImpl.java
示例8: isAssignableTo
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
boolean isAssignableTo(ReferenceType destType) {
if (destType instanceof ArrayType) {
try {
Type destComponentType = ((ArrayType)destType).componentType();
return isComponentAssignable(destComponentType, componentType());
} catch (ClassNotLoadedException e) {
// One or both component types has not yet been
// loaded => can't assign
return false;
}
} else if (destType instanceof InterfaceType) {
// Only valid InterfaceType assignee is Cloneable
return destType.name().equals("java.lang.Cloneable");
} else {
// Only valid ClassType assignee is Object
return destType.name().equals("java.lang.Object");
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:ArrayTypeImpl.java
示例9: addVisibleMethods
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
@Override
void addVisibleMethods(Map<String, Method> methodMap, Set<InterfaceType> seenInterfaces) {
/*
* Add methods from
* parent types first, so that the methods in this class will
* overwrite them in the hash table
*/
Iterator<InterfaceType> iter = superinterfaces().iterator();
while (iter.hasNext()) {
InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
if (!seenInterfaces.contains(interfaze)) {
interfaze.addVisibleMethods(methodMap, seenInterfaces);
seenInterfaces.add(interfaze);
}
}
addToMethodMap(methodMap, methods());
}
开发者ID:campolake,项目名称:openjdk9,代码行数:19,代码来源:InterfaceTypeImpl.java
示例10: getAllMethods
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
List getAllMethods() {
ArrayList list = new ArrayList(methods());
ClassType clazz = superclass();
while (clazz != null) {
list.addAll(clazz.methods());
clazz = clazz.superclass();
}
/*
* Avoid duplicate checking on each method by iterating through
* duplicate-free allInterfaces() rather than recursing
*/
Iterator iter = allInterfaces().iterator();
while (iter.hasNext()) {
InterfaceType interfaze = (InterfaceType)iter.next();
list.addAll(interfaze.methods());
}
return list;
}
开发者ID:campolake,项目名称:openjdk9,代码行数:19,代码来源:ClassTypeImpl.java
示例11: addVisibleMethods
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
@Override
void addVisibleMethods(Map<String, Method> methodMap, Set<InterfaceType> seenInterfaces) {
/*
* Add methods from
* parent types first, so that the methods in this class will
* overwrite them in the hash table
*/
Iterator<InterfaceType> iter = interfaces().iterator();
while (iter.hasNext()) {
InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
if (!seenInterfaces.contains(interfaze)) {
interfaze.addVisibleMethods(methodMap, seenInterfaces);
seenInterfaces.add(interfaze);
}
}
ClassTypeImpl clazz = (ClassTypeImpl)superclass();
if (clazz != null) {
clazz.addVisibleMethods(methodMap, seenInterfaces);
}
addToMethodMap(methodMap, methods());
}
开发者ID:campolake,项目名称:openjdk9,代码行数:25,代码来源:ClassTypeImpl.java
示例12: isAssignableTo
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
boolean isAssignableTo(ReferenceType destType) {
if (destType instanceof ArrayType) {
try {
Type destComponentType = ((ArrayType)destType).componentType();
return isComponentAssignable(destComponentType, componentType());
} catch (ClassNotLoadedException e) {
// One or both component types has not yet been
// loaded => can't assign
return false;
}
} else {
Symbol typeName = ((ReferenceTypeImpl)destType).typeNameAsSymbol();
if (destType instanceof InterfaceType) {
// Every array type implements java.io.Serializable and
// java.lang.Cloneable. fixme in JVMDI-JDI, includes only
// Cloneable but not Serializable.
return typeName.equals(vm.javaLangCloneable()) ||
typeName.equals(vm.javaIoSerializable());
} else {
// Only valid ClassType assignee is Object
return typeName.equals(vm.javaLangObject());
}
}
}
开发者ID:campolake,项目名称:openjdk9,代码行数:25,代码来源:ArrayTypeImpl.java
示例13: getCastableRuntimeType
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
@Nullable
public static PsiType getCastableRuntimeType(Project project, Value value) {
Type type = value.type();
PsiType psiType = findPsiType(project, type);
if (psiType != null) {
return psiType;
}
if (type instanceof ClassType) {
ClassType superclass = ((ClassType)type).superclass();
if (superclass != null && !CommonClassNames.JAVA_LANG_OBJECT.equals(superclass.name())) {
psiType = findPsiType(project, superclass);
if (psiType != null) {
return psiType;
}
}
for (InterfaceType interfaceType : ((ClassType)type).interfaces()) {
psiType = findPsiType(project, interfaceType);
if (psiType != null) {
return psiType;
}
}
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:RuntimeTypeEvaluator.java
示例14: isF3Type
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
/**
* JDI addition: Determines if this is a F3 type.
*
* @return <code>true</code> if this is a F3 type; false otherwise.
*/
public boolean isF3Type() {
if (!isIsF3TypeSet) {
isIsF3TypeSet = true;
F3VirtualMachine f3vm = virtualMachine();
InterfaceType f3ObjType = (InterfaceType) F3Wrapper.unwrap(f3vm.f3ObjectType());
if (f3ObjType != null) {
InterfaceType thisType = underlying();
List<InterfaceType> allIfaces = thisType.superinterfaces();
for (InterfaceType iface : allIfaces) {
if (iface.equals(f3ObjType)) {
isF3Type = true;
break;
}
}
}
}
return isF3Type;
}
开发者ID:unktomi,项目名称:form-follows-function,代码行数:24,代码来源:F3InterfaceType.java
示例15: getCastableRuntimeType
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
public static PsiClass getCastableRuntimeType(Project project, Value value) {
Type type = value.type();
PsiClass psiClass = findPsiClass(project, type);
if (psiClass != null) {
return psiClass;
}
if (type instanceof ClassType) {
ClassType superclass = ((ClassType)type).superclass();
if (superclass != null && !CommonClassNames.JAVA_LANG_OBJECT.equals(superclass.name())) {
psiClass = findPsiClass(project, superclass);
if (psiClass != null) {
return psiClass;
}
}
for (InterfaceType interfaceType : ((ClassType)type).interfaces()) {
psiClass = findPsiClass(project, interfaceType);
if (psiClass != null) {
return psiClass;
}
}
}
return null;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:RuntimeTypeEvaluator.java
示例16: ungrabWindowFX
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
private boolean ungrabWindowFX(ThreadReference tr) {
// javafx.stage.Window.impl_getWindows() - Iterator<Window>
// while (iterator.hasNext()) {
// Window w = iterator.next();
// ungrabWindowFX(w);
// }
try {
VirtualMachine vm = MirrorWrapper.virtualMachine(tr);
List<ReferenceType> windowClassesByName = VirtualMachineWrapper.classesByName(vm, "javafx.stage.Window");
if (windowClassesByName.isEmpty()) {
logger.info("Unable to release FX X grab, no javafx.stage.Window class in target VM "+VirtualMachineWrapper.description(vm));
return true; // We do not know whether there was any grab
}
ClassType WindowClass = (ClassType) windowClassesByName.get(0);
Method getWindowsMethod = WindowClass.concreteMethodByName("impl_getWindows", "()Ljava/util/Iterator;");
if (getWindowsMethod == null) {
logger.info("Unable to release FX X grab, no impl_getWindows() method in "+WindowClass);
return true; // We do not know whether there was any grab
}
ObjectReference windowsIterator = (ObjectReference) WindowClass.invokeMethod(tr, getWindowsMethod, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
if (windowsIterator == null) {
return true; // We do not know whether there was any grab
}
InterfaceType IteratorClass = (InterfaceType) VirtualMachineWrapper.classesByName(vm, Iterator.class.getName()).get(0);
Method hasNext = IteratorClass.methodsByName("hasNext", "()Z").get(0);
Method next = IteratorClass.methodsByName("next", "()Ljava/lang/Object;").get(0);
while (hasNext(hasNext, tr, windowsIterator)) {
ObjectReference w = next(next, tr, windowsIterator);
ungrabWindowFX(WindowClass, w, tr);
}
} catch (VMDisconnectedExceptionWrapper vmdex) {
return true; // Disconnected, all is good.
} catch (Exception ex) {
logger.log(Level.INFO, "Unable to release FX X grab (if any).", ex);
return true; // We do not know whether there was any grab
}
return true;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:AWTGrabHandler.java
示例17: pauseMedia
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
private static void pauseMedia(ThreadReference tr, VirtualMachine vm) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException {
final ClassType audioClipClass = getClass(vm, tr, "com.sun.media.jfxmedia.AudioClip");
final ClassType mediaManagerClass = getClass(vm, tr, "com.sun.media.jfxmedia.MediaManager");
final InterfaceType mediaPlayerClass = getInterface(vm, tr, "com.sun.media.jfxmedia.MediaPlayer");
final ClassType playerStateEnum = getClass(vm, tr, "com.sun.media.jfxmedia.events.PlayerStateEvent$PlayerState");
if (audioClipClass != null) {
Method stopAllClips = audioClipClass.concreteMethodByName("stopAllClips", "()V");
audioClipClass.invokeMethod(tr, stopAllClips, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
}
if (mediaManagerClass != null && mediaPlayerClass != null && playerStateEnum != null) {
Method getAllPlayers = mediaManagerClass.concreteMethodByName("getAllMediaPlayers", "()Ljava/util/List;");
ObjectReference plList = (ObjectReference)mediaManagerClass.invokeMethod(tr, getAllPlayers, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
if (plList != null) {
ClassType listType = (ClassType)plList.referenceType();
Method iterator = listType.concreteMethodByName("iterator", "()Ljava/util/Iterator;");
ObjectReference plIter = (ObjectReference)plList.invokeMethod(tr, iterator, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
ClassType iterType = (ClassType)plIter.referenceType();
Method hasNext = iterType.concreteMethodByName("hasNext", "()Z");
Method next = iterType.concreteMethodByName("next", "()Ljava/lang/Object;");
Field playingState = playerStateEnum.fieldByName("PLAYING");
Method getState = mediaPlayerClass.methodsByName("getState", "()Lcom/sun/media/jfxmedia/events/PlayerStateEvent$PlayerState;").get(0);
Method pausePlayer = mediaPlayerClass.methodsByName("pause", "()V").get(0);
boolean hasNextFlag = false;
do {
BooleanValue v = (BooleanValue)plIter.invokeMethod(tr, hasNext, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
hasNextFlag = v.booleanValue();
if (hasNextFlag) {
ObjectReference player = (ObjectReference)plIter.invokeMethod(tr, next, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
ObjectReference curState = (ObjectReference)player.invokeMethod(tr, getState, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
if (playingState.equals(curState)) {
player.invokeMethod(tr, pausePlayer, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
pausedPlayers.add(player);
}
}
} while (hasNextFlag);
}
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:47,代码来源:RemoteFXScreenshot.java
示例18: resumeMedia
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
private static void resumeMedia(ThreadReference tr, VirtualMachine vm) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException {
if (!pausedPlayers.isEmpty()) {
final InterfaceType mediaPlayerClass = getInterface(vm, tr, "com.sun.media.jfxmedia.MediaPlayer");
List<Method> play = mediaPlayerClass.methodsByName("play", "()V");
if (play.isEmpty()) {
return;
}
Method p = play.iterator().next();
for(ObjectReference pR : pausedPlayers) {
pR.invokeMethod(tr, p, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
}
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:RemoteFXScreenshot.java
示例19: getInterface
import com.sun.jdi.InterfaceType; //导入依赖的package包/类
private static InterfaceType getInterface(VirtualMachine vm, ThreadReference tr, String name) {
ReferenceType t = getType(vm, tr, name);
if (t instanceof InterfaceType) {
return (InterfaceType)t;
}
logger.log(Level.WARNING, "{0} is not an interface but {1}", new Object[]{name, t}); // NOI18N
return null;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:RemoteFXScreenshot.java
注:本文中的com.sun.jdi.InterfaceType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论