本文整理汇总了Golang中github.com/zxh0/jvm/go/jvmgo/classfile.MemberInfo类的典型用法代码示例。如果您正苦于以下问题:Golang MemberInfo类的具体用法?Golang MemberInfo怎么用?Golang MemberInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MemberInfo类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: newField
func newField(class *Class, fieldInfo *cf.MemberInfo) *Field {
field := &Field{}
field.class = class
field.accessFlags = fieldInfo.AccessFlags()
field.name = fieldInfo.Name()
field.descriptor = fieldInfo.Descriptor()
field.signature = fieldInfo.Signature()
field.IsLongOrDouble = (field.descriptor == "J" || field.descriptor == "D")
if kValAttr := fieldInfo.ConstantValueAttribute(); kValAttr != nil {
field.constValueIndex = kValAttr.ConstantValueIndex()
}
return field
}
示例2: newMethod
func newMethod(class *Class, methodInfo *cf.MemberInfo) *Method {
method := &Method{}
method.class = class
method.accessFlags = methodInfo.AccessFlags()
method.name = methodInfo.Name()
method.descriptor = methodInfo.Descriptor()
method.md = parseMethodDescriptor(method.descriptor)
method.calcArgSlotCount()
method.copyAttributes(methodInfo)
return method
}
示例3: copyAttributes
func (self *Method) copyAttributes(methodInfo *cf.MemberInfo) {
if codeAttr := methodInfo.CodeAttribute(); codeAttr != nil {
self.exceptions = methodInfo.ExceptionsAttribute()
self.signature = methodInfo.Signature()
self.code = codeAttr.Code()
self.maxStack = codeAttr.MaxStack()
self.maxLocals = codeAttr.MaxLocals()
self.lineNumberTable = codeAttr.LineNumberTableAttribute()
if len(codeAttr.ExceptionTable()) > 0 {
rtCp := self.class.constantPool
self.copyExceptionTable(codeAttr.ExceptionTable(), rtCp)
}
}
self.annotationData = methodInfo.RuntimeVisibleAnnotationsAttributeData()
self.parameterAnnotationData = methodInfo.RuntimeVisibleParameterAnnotationsAttributeData()
self.annotationDefaultData = methodInfo.AnnotationDefaultAttributeData()
}