當前位置: 首頁>>代碼示例>>Java>>正文


Java ReplyPacket.getNextValueAsFieldID方法代碼示例

本文整理匯總了Java中org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket.getNextValueAsFieldID方法的典型用法代碼示例。如果您正苦於以下問題:Java ReplyPacket.getNextValueAsFieldID方法的具體用法?Java ReplyPacket.getNextValueAsFieldID怎麽用?Java ReplyPacket.getNextValueAsFieldID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket的用法示例。


在下文中一共展示了ReplyPacket.getNextValueAsFieldID方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getFieldID

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //導入方法依賴的package包/類
/**
 * Gets FieldID from ReplyPacket.
 * 
 * @param request
 *            ReplyPacket for request
 * @param field
 *            field name to get ID for
 * @return received FieldID
 */
public long getFieldID(ReplyPacket request, String field) {
    long fieldID = -1;
    String fieldName;
    // Get fieldID from received packet
    int count = request.getNextValueAsInt();
    for (int i = 0; i < count; i++) {
        fieldID = request.getNextValueAsFieldID();
        fieldName = request.getNextValueAsString();
        if (field.equals(fieldName)) {
            request.getNextValueAsString();
            request.getNextValueAsInt();
            break;
        } else {
            request.getNextValueAsString();
            request.getNextValueAsInt();
            fieldID = 0;
            fieldName = null;
        }
    }
    return fieldID;
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:31,代碼來源:VmMirror.java

示例2: getAllFields

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //導入方法依賴的package包/類
/**
 * Returns information for each field in a reference type including
 * inherited fields
 * 
 * @param classID
 *            The reference type ID
 * @return A list of Field objects representing each field of the class
 */
public final List getAllFields(long classID) {
    ArrayList<Field> fields = new ArrayList<Field>(0);

    long superID = getSuperclassId(classID);
    if (superID != 0) {
        List superClassFields = getAllFields(superID);
        for (int i = 0; i < superClassFields.size(); i++) {
            fields.add((Field) superClassFields.toArray()[i]);
        }
    }

    ReplyPacket reply = getFieldsInClass(classID);
    int fieldsCount = reply.getNextValueAsInt();
    for (int i = 0; i < fieldsCount; i++) {
        Field field = new Field(reply.getNextValueAsFieldID(), classID,
                reply.getNextValueAsString(), reply.getNextValueAsString(),
                reply.getNextValueAsInt());
        fields.add(field);
    }

    return fields;
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:31,代碼來源:VmMirror.java

示例3: jdwpGetFields

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //導入方法依賴的package包/類
/**
 * Returns for specified class array with information about fields of this class.
 * <BR>Each element of array contains: 
 * <BR>Field ID, Field name, Field signature, Field modifier bit flags; 
 * @param refType - ReferenceTypeID, defining class.
 * @return array with information about fields.
 */
protected FieldInfo[] jdwpGetFields(long refType) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
            JDWPCommands.ReferenceTypeCommandSet.FieldsCommand);
    packet.setNextValueAsReferenceTypeID(refType);
    
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    assertTrue(reply.getErrorCode() == JDWPConstants.Error.NONE);
    
    int declared = reply.getNextValueAsInt();
    FieldInfo[] fields = new FieldInfo[declared];
    for (int i = 0; i < declared; i++) {
        fields[i] =
            new FieldInfo(reply.getNextValueAsFieldID(),
                          reply.getNextValueAsString(),
                          reply.getNextValueAsString(),
                          reply.getNextValueAsInt());
    }
    return fields;
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:28,代碼來源:JDWPClassTypeTestCase.java

示例4: jdwpGetFieldIDs

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //導入方法依賴的package包/類
private FieldInfo[] jdwpGetFieldIDs(long classID) {
    CommandPacket packet = new CommandPacket(
            JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
            JDWPCommands.ReferenceTypeCommandSet.FieldsCommand);
    packet.setNextValueAsReferenceTypeID(classID);
    
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "ReferenceType::Fields command");
    
    int declared = reply.getNextValueAsInt();
    FieldInfo[] fields = new FieldInfo[declared];
    for (int i = 0; i < declared; i++) {
        fields[i] = new FieldInfo(
                reply.getNextValueAsFieldID(),
                reply.getNextValueAsString(),
                reply.getNextValueAsString(),
                reply.getNextValueAsInt()
                );
    }
    
    return fields;
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:23,代碼來源:SetValuesTest.java

示例5: testLength001

import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //導入方法依賴的package包/類
/**
 * This testcase exercises ArrayReference.Length command.
 * <BR>Starts <A HREF="ArrayReferenceDebuggee.html">ArrayReferenceDebuggee</A>. 
 * <BR>Receives fields with ReferenceType.fields command, 
 * checks length with ArrayReference.Length command.
 */
public void testLength001() throws UnsupportedEncodingException {
    logWriter.println("testLength001 started");
    synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);

    // obtain classID
    long classID = getClassIDBySignature("Lorg/apache/harmony/jpda/tests/jdwp/ArrayReference/ArrayReferenceDebuggee;");

    // obtain fields
    CommandPacket packet = new CommandPacket(
            JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
            JDWPCommands.ReferenceTypeCommandSet.FieldsCommand);
    packet.setNextValueAsReferenceTypeID(classID);
    ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
    checkReplyPacket(reply, "ReferenceType::Fields command");
    
    int declared = reply.getNextValueAsInt();
    for (int i = 0; i < declared; i++) {
        long fieldID = reply.getNextValueAsFieldID();
        reply.getNextValueAsString();
        reply.getNextValueAsString();
        reply.getNextValueAsInt();
        
        switch (i) {
            case 0:
                // int[] intArray = new int[10]
                checkArrayLength(classID, fieldID, JDWPConstants.Error.NONE, 10);
                break;
            case 1:
                // String[] strArray = new String[8]
                checkArrayLength(classID, fieldID, JDWPConstants.Error.NONE, 8);
                break;
            case 2:
                // Integer intField = new Integer(-1)
                checkArrayLength(classID, fieldID, JDWPConstants.Error.INVALID_ARRAY, 0);
                break;
        }
    }

    logWriter.println("test PASSED!");
    synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:48,代碼來源:LengthTest.java


注:本文中的org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket.getNextValueAsFieldID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。