当前位置: 首页>>代码示例>>Java>>正文


Java ReferenceType.fieldByName方法代码示例

本文整理汇总了Java中com.sun.jdi.ReferenceType.fieldByName方法的典型用法代码示例。如果您正苦于以下问题:Java ReferenceType.fieldByName方法的具体用法?Java ReferenceType.fieldByName怎么用?Java ReferenceType.fieldByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.jdi.ReferenceType的用法示例。


在下文中一共展示了ReferenceType.fieldByName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stopDebuggerRemoteService

import com.sun.jdi.ReferenceType; //导入方法依赖的package包/类
private void stopDebuggerRemoteService(JPDADebugger d) {
    ClassObjectReference serviceClass = RemoteServices.getServiceClass(d, RemoteServices.ServiceType.AWT);
    if (serviceClass == null) {
        return ;
    }
    try {
        ReferenceType serviceType = serviceClass.reflectedType();
        Field awtAccessLoop = serviceType.fieldByName("awtAccessLoop"); // NOI18N
        if (awtAccessLoop != null) {
            ((ClassType) serviceType).setValue(awtAccessLoop, serviceClass.virtualMachine().mirrorOf(false));
        }
        serviceClass.enableCollection();
    } catch (VMDisconnectedException vdex) {
        // Ignore
    } catch (Exception ex) {
        Exceptions.printStackTrace(ex);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:VisualDebuggerListener.java

示例2: fieldByName

import com.sun.jdi.ReferenceType; //导入方法依赖的package包/类
@Override
public Field fieldByName(String string) {
    for (ReferenceType t : types) {
        Field field = t.fieldByName(string);
        if (field != null) {
            return field;
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:EvaluatorVisitor.java

示例3: addFieldWatch

import com.sun.jdi.ReferenceType; //导入方法依赖的package包/类
private static void addFieldWatch(VirtualMachine vm,
    ReferenceType refType) {
  EventRequestManager erm = vm.eventRequestManager();
  Field field = refType.fieldByName(FIELD_NAME);
  ModificationWatchpointRequest modificationWatchpointRequest = erm
      .createModificationWatchpointRequest(field);
  modificationWatchpointRequest.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
  modificationWatchpointRequest.setEnabled(true);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:10,代码来源:FieldMonitor.java

示例4: handleSetValueForStackFrame

import com.sun.jdi.ReferenceType; //导入方法依赖的package包/类
private Value handleSetValueForStackFrame(String name, String belongToClass, String valueString,
        boolean showStaticVariables, StackFrame container, Map<String, Object> options)
                throws AbsentInformationException, InvalidTypeException, ClassNotLoadedException {
    Value newValue;
    if (name.equals("this")) {
        throw new UnsupportedOperationException("SetVariableRequest: 'This' variable cannot be changed.");
    }
    LocalVariable variable = container.visibleVariableByName(name);
    if (StringUtils.isBlank(belongToClass) && variable != null) {
        newValue = this.setFrameValue(container, variable, valueString, options);
    } else {
        if (showStaticVariables && container.location().method().isStatic()) {
            ReferenceType type = container.location().declaringType();
            if (StringUtils.isBlank(belongToClass)) {
                Field field = type.fieldByName(name);
                newValue = setStaticFieldValue(type, field, name, valueString, options);
            } else {
                newValue = setFieldValueWithConflict(null, type.allFields(), name, belongToClass,
                        valueString, options);
            }
        } else {
            throw new UnsupportedOperationException(
                    String.format("SetVariableRequest: Variable %s cannot be found.", name));
        }
    }
    return newValue;
}
 
开发者ID:Microsoft,项目名称:java-debug,代码行数:28,代码来源:SetVariableRequestHandler.java

示例5: process

import com.sun.jdi.ReferenceType; //导入方法依赖的package包/类
public void process(String accessControlClass, int lineNum) throws Exception {
  EventRequestManager erm = vm.eventRequestManager();
  Optional<ReferenceType> classRef = getFirstClassReference(accessControlClass);
  if (!classRef.isPresent()) {
    throw new ClassNotFoundException(String.format("Class %s not found", accessControlClass));
  }

  ReferenceType accRef = classRef.get();
  Field contextField = accRef.fieldByName("context");

  Location location = accRef.locationsOfLine(lineNum).get(0);

  BreakpointRequest br = erm.createBreakpointRequest(location);
  loop(br, contextField);
}
 
开发者ID:coyotesqrl,项目名称:acdebugger,代码行数:16,代码来源:PermissionDebugger.java


注:本文中的com.sun.jdi.ReferenceType.fieldByName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。