1 6 7 package com.yworks.yguard.obf.classfile; 8 9 import com.yworks.yguard.ParseException; 10 import java.io.DataInput ; 11 import java.io.DataOutput ; 12 import java.io.IOException ; 13 14 public class ElementValuePairInfo 15 { 16 protected int u2ElementNameIndex; 17 protected ElementValueInfo elementValue; 18 19 private ElementValuePairInfo() 20 {} 21 22 public static ElementValuePairInfo create(DataInput din) throws IOException 23 { 24 ElementValuePairInfo evp = new ElementValuePairInfo(); 25 evp.read(din); 26 return evp; 27 } 28 29 protected void read(DataInput din) throws java.io.IOException 30 { 31 u2ElementNameIndex = din.readUnsignedShort(); 32 elementValue = ElementValueInfo.create(din); 33 } 34 35 protected void markUtf8RefsInInfo(ConstantPool pool) { 36 pool.getCpEntry(u2ElementNameIndex).incRefCount(); 37 elementValue.markUtf8RefsInInfo(pool); 38 } 39 40 41 public void write(DataOutput dout) throws java.io.IOException 42 { 43 dout.writeShort(u2ElementNameIndex); 44 elementValue.write(dout); 45 } 46 } 47 | Popular Tags |