Package xyz.cofe.trambda.bc.cls
Class CAnnotation
- java.lang.Object
-
- xyz.cofe.trambda.bc.cls.CAnnotation
-
- All Implemented Interfaces:
Serializable,xyz.cofe.collection.ImTree<ByteCode>,xyz.cofe.collection.ImTreeWalk<ByteCode>,AnnotationDef,GetAnnotationByteCodes,ByteCode,ClazzWriter,ClsByteCode
public class CAnnotation extends Object implements ClsByteCode, AnnotationDef, GetAnnotationByteCodes, ClazzWriter
Аннотация прикрепленная к классуЕсть такие классы
public @interface Desc { String value(); } @Desc("sample User2") public class User2 { public User2(){} public User2(String name1){ this.name = name1; } @Desc("name of user") private String name; @Desc("name of user") public String getName(){ return name; } public void setName( @Required @MaxLength(100) @MinLength(1) String name ){ this.name = name; } private ListВ результате будетemails; @Desc("emails of user") public List getEmails(){ return emails; } public void setEmails( List emails ){ this.emails = emails; } } <CBegin version="55" access="33" name="xyz/cofe/bc/xml/clss/User2" superName="java/lang/Object" interface="false"> <CSource order="0" source="User2.java"/> <CAnnotation order="1" visible="true" descriptor="Lxyz/cofe/bc/xml/clss/Desc;"> <APairString name="value"> <APairStringValue>sample User2</APairStringValue> </APairString> <AEnd/> </CAnnotation>- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<AnnotationByteCode>annotationByteCodesвложенные параметры аннотацииprotected StringdescriptorИмя типа аннотацииprotected booleanvisibletrue если аннотация видна в runtime
-
Constructor Summary
Constructors Constructor Description CAnnotation()Конструктор по умолчаниюCAnnotation(String descriptor, boolean visible)КонструкторCAnnotation(CAnnotation sample)Конструктор копирования
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CAnnotationclone()CAnnotationconfigure(Consumer<CAnnotation> conf)Конфигурация экземпляраList<AnnotationByteCode>getAnnotationByteCodes()Указывает вложенные параметры аннотацииStringgetDescriptor()Возвращает имя типа аннотацииbooleanisVisible()Возвращает видна ли аннотация в runtimexyz.cofe.iter.Eterable<ByteCode>nodes()Возвращает дочерние узлыvoidsetAnnotationByteCodes(List<AnnotationByteCode> byteCodes)Возвращает вложенные параметры аннотацииvoidsetDescriptor(String descriptor)Указывает имя типа аннотацииvoidsetVisible(boolean visible)Указывает видна ли аннотация в runtimeStringtoString()voidwrite(org.objectweb.asm.ClassWriter v)
-
-
-
Field Detail
-
descriptor
protected String descriptor
Имя типа аннотации
-
visible
protected boolean visible
true если аннотация видна в runtime
-
annotationByteCodes
protected List<AnnotationByteCode> annotationByteCodes
вложенные параметры аннотации
-
-
Constructor Detail
-
CAnnotation
public CAnnotation()
Конструктор по умолчанию
-
CAnnotation
public CAnnotation(String descriptor, boolean visible)
Конструктор- Parameters:
descriptor- имя типа аннотацииvisible- true если аннотация видна в runtime
-
CAnnotation
public CAnnotation(CAnnotation sample)
Конструктор копирования- Parameters:
sample- образец
-
-
Method Detail
-
clone
public CAnnotation clone()
- Specified by:
clonein interfaceClsByteCode- Overrides:
clonein classObject
-
configure
public CAnnotation configure(Consumer<CAnnotation> conf)
Конфигурация экземпляра- Parameters:
conf- конфигурация- Returns:
- SELF ссылка
-
getDescriptor
public String getDescriptor()
Возвращает имя типа аннотации- Returns:
- имя типа аннотации
-
setDescriptor
public void setDescriptor(String descriptor)
Указывает имя типа аннотации- Parameters:
descriptor- имя типа аннотации
-
isVisible
public boolean isVisible()
Возвращает видна ли аннотация в runtime- Returns:
- true если аннотация видна в runtime
-
setVisible
public void setVisible(boolean visible)
Указывает видна ли аннотация в runtime- Parameters:
visible- true если аннотация видна в runtime
-
getAnnotationByteCodes
public List<AnnotationByteCode> getAnnotationByteCodes()
Указывает вложенные параметры аннотации- Specified by:
getAnnotationByteCodesin interfaceGetAnnotationByteCodes- Returns:
- вложенные параметры аннотации
-
setAnnotationByteCodes
public void setAnnotationByteCodes(List<AnnotationByteCode> byteCodes)
Возвращает вложенные параметры аннотации- Parameters:
byteCodes- вложенные параметры аннотации
-
nodes
public xyz.cofe.iter.Eterable<ByteCode> nodes()
Возвращает дочерние узлы
-
write
public void write(org.objectweb.asm.ClassWriter v)
- Specified by:
writein interfaceClazzWriter
-
-