本文整理了Java中com.android.dx.rop.annotation.Annotations.add()
方法的一些代码示例,展示了Annotations.add()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotations.add()
方法的具体详情如下:
包路径:com.android.dx.rop.annotation.Annotations
类名称:Annotations
方法名:add
[英]Adds an element to this instance. There must not already be an element of the same type.
[中]将元素添加到此实例。不能已有相同类型的元素。
代码示例来源:origin: linkedin/dexmaker
annotation.add(nvp);
annotations.add(annotation);
classDefItem.addMethodAnnotations(cstMethodRef, annotations, dexMaker.getDexFile());
代码示例来源:origin: nikita36078/J2ME-Loader
/**
* Constructs an immutable instance which is the combination of the
* given instance with the given additional annotation. The latter's
* type must not already appear in the former.
*
* @param annotations {@code non-null;} the instance to augment
* @param annotation {@code non-null;} the additional annotation
* @return {@code non-null;} the combination
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public static Annotations combine(Annotations annotations,
Annotation annotation) {
Annotations result = new Annotations();
result.addAll(annotations);
result.add(annotation);
result.setImmutable();
return result;
}
代码示例来源:origin: com.google.android.tools/dx
/**
* Constructs an immutable instance which is the combination of the
* given instance with the given additional annotation. The latter's
* type must not already appear in the former.
*
* @param annotations {@code non-null;} the instance to augment
* @param annotation {@code non-null;} the additional annotation
* @return {@code non-null;} the combination
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public static Annotations combine(Annotations annotations,
Annotation annotation) {
Annotations result = new Annotations();
result.addAll(annotations);
result.add(annotation);
result.setImmutable();
return result;
}
代码示例来源:origin: com.google.dexmaker/dexmaker-dx
/**
* Adds all of the elements of the given instance to this one. The
* instances must not have any duplicate types.
*
* @param toAdd {@code non-null;} the annotations to add
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public void addAll(Annotations toAdd) {
throwIfImmutable();
if (toAdd == null) {
throw new NullPointerException("toAdd == null");
}
for (Annotation a : toAdd.annotations.values()) {
add(a);
}
}
代码示例来源:origin: gdpancheng/LoonAndroid3
/**
* Constructs an immutable instance which is the combination of the
* given instance with the given additional annotation. The latter's
* type must not already appear in the former.
*
* @param annotations {@code non-null;} the instance to augment
* @param annotation {@code non-null;} the additional annotation
* @return {@code non-null;} the combination
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public static Annotations combine(Annotations annotations,
Annotation annotation) {
Annotations result = new Annotations();
result.addAll(annotations);
result.add(annotation);
result.setImmutable();
return result;
}
代码示例来源:origin: nikita36078/J2ME-Loader
/**
* Adds all of the elements of the given instance to this one. The
* instances must not have any duplicate types.
*
* @param toAdd {@code non-null;} the annotations to add
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public void addAll(Annotations toAdd) {
throwIfImmutable();
if (toAdd == null) {
throw new NullPointerException("toAdd == null");
}
for (Annotation a : toAdd.annotations.values()) {
add(a);
}
}
代码示例来源:origin: com.android.tools.build/builder
/**
* Constructs an immutable instance which is the combination of the
* given instance with the given additional annotation. The latter's
* type must not already appear in the former.
*
* @param annotations {@code non-null;} the instance to augment
* @param annotation {@code non-null;} the additional annotation
* @return {@code non-null;} the combination
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public static Annotations combine(Annotations annotations,
Annotation annotation) {
Annotations result = new Annotations();
result.addAll(annotations);
result.add(annotation);
result.setImmutable();
return result;
}
代码示例来源:origin: com.google.android.tools/dx
/**
* Adds all of the elements of the given instance to this one. The
* instances must not have any duplicate types.
*
* @param toAdd {@code non-null;} the annotations to add
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public void addAll(Annotations toAdd) {
throwIfImmutable();
if (toAdd == null) {
throw new NullPointerException("toAdd == null");
}
for (Annotation a : toAdd.annotations.values()) {
add(a);
}
}
代码示例来源:origin: com.jakewharton.android.repackaged/dalvik-dx
/**
* Constructs an immutable instance which is the combination of the
* given instance with the given additional annotation. The latter's
* type must not already appear in the former.
*
* @param annotations {@code non-null;} the instance to augment
* @param annotation {@code non-null;} the additional annotation
* @return {@code non-null;} the combination
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public static Annotations combine(Annotations annotations,
Annotation annotation) {
Annotations result = new Annotations();
result.addAll(annotations);
result.add(annotation);
result.setImmutable();
return result;
}
代码示例来源:origin: com.android/dx
/**
* Adds all of the elements of the given instance to this one. The
* instances must not have any duplicate types.
*
* @param toAdd {@code non-null;} the annotations to add
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public void addAll(Annotations toAdd) {
throwIfImmutable();
if (toAdd == null) {
throw new NullPointerException("toAdd == null");
}
for (Annotation a : toAdd.annotations.values()) {
add(a);
}
}
代码示例来源:origin: com.android/dx
/**
* Constructs an immutable instance which is the combination of the
* given instance with the given additional annotation. The latter's
* type must not already appear in the former.
*
* @param annotations {@code non-null;} the instance to augment
* @param annotation {@code non-null;} the additional annotation
* @return {@code non-null;} the combination
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public static Annotations combine(Annotations annotations,
Annotation annotation) {
Annotations result = new Annotations();
result.addAll(annotations);
result.add(annotation);
result.setImmutable();
return result;
}
代码示例来源:origin: gdpancheng/LoonAndroid3
/**
* Adds all of the elements of the given instance to this one. The
* instances must not have any duplicate types.
*
* @param toAdd {@code non-null;} the annotations to add
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public void addAll(Annotations toAdd) {
throwIfImmutable();
if (toAdd == null) {
throw new NullPointerException("toAdd == null");
}
for (Annotation a : toAdd.annotations.values()) {
add(a);
}
}
代码示例来源:origin: com.google.dexmaker/dexmaker-dx
/**
* Constructs an immutable instance which is the combination of the
* given instance with the given additional annotation. The latter's
* type must not already appear in the former.
*
* @param annotations {@code non-null;} the instance to augment
* @param annotation {@code non-null;} the additional annotation
* @return {@code non-null;} the combination
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public static Annotations combine(Annotations annotations,
Annotation annotation) {
Annotations result = new Annotations();
result.addAll(annotations);
result.add(annotation);
result.setImmutable();
return result;
}
代码示例来源:origin: com.android.tools.build/builder
/**
* Adds all of the elements of the given instance to this one. The
* instances must not have any duplicate types.
*
* @param toAdd {@code non-null;} the annotations to add
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public void addAll(Annotations toAdd) {
throwIfImmutable();
if (toAdd == null) {
throw new NullPointerException("toAdd == null");
}
for (Annotation a : toAdd.annotations.values()) {
add(a);
}
}
代码示例来源:origin: dragome/dragome-sdk
/**
* Constructs an immutable instance which is the combination of the
* given instance with the given additional annotation. The latter's
* type must not already appear in the former.
*
* @param annotations {@code non-null;} the instance to augment
* @param annotation {@code non-null;} the additional annotation
* @return {@code non-null;} the combination
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public static Annotations combine(Annotations annotations,
Annotation annotation) {
Annotations result = new Annotations();
result.addAll(annotations);
result.add(annotation);
result.setImmutable();
return result;
}
代码示例来源:origin: com.jakewharton.android.repackaged/dalvik-dx
/**
* Adds all of the elements of the given instance to this one. The
* instances must not have any duplicate types.
*
* @param toAdd {@code non-null;} the annotations to add
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public void addAll(Annotations toAdd) {
throwIfImmutable();
if (toAdd == null) {
throw new NullPointerException("toAdd == null");
}
for (Annotation a : toAdd.annotations.values()) {
add(a);
}
}
代码示例来源:origin: dragome/dragome-sdk
/**
* Adds all of the elements of the given instance to this one. The
* instances must not have any duplicate types.
*
* @param toAdd {@code non-null;} the annotations to add
* @throws IllegalArgumentException thrown if there is a duplicate type
*/
public void addAll(Annotations toAdd) {
throwIfImmutable();
if (toAdd == null) {
throw new NullPointerException("toAdd == null");
}
for (Annotation a : toAdd.annotations.values()) {
add(a);
}
}
代码示例来源:origin: dragome/dragome-sdk
/**
* Parses an annotation list.
*
* @param visibility {@code non-null;} visibility of the parsed annotations
* @return {@code non-null;} the list of annotations read from the attribute
* data
*/
private Annotations parseAnnotations(AnnotationVisibility visibility)
throws IOException {
int count = input.readUnsignedShort();
if (observer != null) {
parsed(2, "num_annotations: " + Hex.u2(count));
}
Annotations annotations = new Annotations();
for (int i = 0; i < count; i++) {
if (observer != null) {
parsed(0, "annotations[" + i + "]:");
changeIndent(1);
}
Annotation annotation = parseAnnotation(visibility);
annotations.add(annotation);
if (observer != null) {
observer.changeIndent(-1);
}
}
annotations.setImmutable();
return annotations;
}
代码示例来源:origin: com.android/dx
/**
* Parses an annotation list.
*
* @param visibility {@code non-null;} visibility of the parsed annotations
* @return {@code non-null;} the list of annotations read from the attribute
* data
*/
private Annotations parseAnnotations(AnnotationVisibility visibility)
throws IOException {
int count = input.readUnsignedShort();
if (observer != null) {
parsed(2, "num_annotations: " + Hex.u2(count));
}
Annotations annotations = new Annotations();
for (int i = 0; i < count; i++) {
if (observer != null) {
parsed(0, "annotations[" + i + "]:");
changeIndent(1);
}
Annotation annotation = parseAnnotation(visibility);
annotations.add(annotation);
if (observer != null) {
observer.changeIndent(-1);
}
}
annotations.setImmutable();
return annotations;
}
代码示例来源:origin: nikita36078/J2ME-Loader
/**
* Parses an annotation list.
*
* @param visibility {@code non-null;} visibility of the parsed annotations
* @return {@code non-null;} the list of annotations read from the attribute
* data
*/
private Annotations parseAnnotations(AnnotationVisibility visibility)
throws IOException {
int count = input.readUnsignedShort();
if (observer != null) {
parsed(2, "num_annotations: " + Hex.u2(count));
}
Annotations annotations = new Annotations();
for (int i = 0; i < count; i++) {
if (observer != null) {
parsed(0, "annotations[" + i + "]:");
changeIndent(1);
}
Annotation annotation = parseAnnotation(visibility);
annotations.add(annotation);
if (observer != null) {
observer.changeIndent(-1);
}
}
annotations.setImmutable();
return annotations;
}
内容来源于网络,如有侵权,请联系作者删除!