com.android.dx.rop.annotation.NameValuePair.getName()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(10.7k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中com.android.dx.rop.annotation.NameValuePair.getName()方法的一些代码示例,展示了NameValuePair.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NameValuePair.getName()方法的具体详情如下:
包路径:com.android.dx.rop.annotation.NameValuePair
类名称:NameValuePair
方法名:getName

NameValuePair.getName介绍

[英]Gets the name.
[中]获取名称。

代码示例

代码示例来源:origin: com.jakewharton.android.repackaged/dalvik-dx

/**
 * Put an element into the set of (name, value) pairs for this instance.
 * If there is a preexisting element with the same name, it will be
 * replaced by this method.
 *
 * @param pair {@code non-null;} the (name, value) pair to place into this instance
 */
public void put(NameValuePair pair) {
  throwIfImmutable();
  if (pair == null) {
    throw new NullPointerException("pair == null");
  }
  elements.put(pair.getName(), pair);
}

代码示例来源:origin: com.google.android.tools/dx

/**
 * Put an element into the set of (name, value) pairs for this instance.
 * If there is a preexisting element with the same name, it will be
 * replaced by this method.
 *
 * @param pair {@code non-null;} the (name, value) pair to place into this instance
 */
public void put(NameValuePair pair) {
  throwIfImmutable();
  if (pair == null) {
    throw new NullPointerException("pair == null");
  }
  elements.put(pair.getName(), pair);
}

代码示例来源:origin: com.google.dexmaker/dexmaker-dx

/**
 * Put an element into the set of (name, value) pairs for this instance.
 * If there is a preexisting element with the same name, it will be
 * replaced by this method.
 *
 * @param pair {@code non-null;} the (name, value) pair to place into this instance
 */
public void put(NameValuePair pair) {
  throwIfImmutable();
  if (pair == null) {
    throw new NullPointerException("pair == null");
  }
  elements.put(pair.getName(), pair);
}

代码示例来源:origin: nikita36078/J2ME-Loader

/**
 * Put an element into the set of (name, value) pairs for this instance.
 * If there is a preexisting element with the same name, it will be
 * replaced by this method.
 *
 * @param pair {@code non-null;} the (name, value) pair to place into this instance
 */
public void put(NameValuePair pair) {
  throwIfImmutable();
  if (pair == null) {
    throw new NullPointerException("pair == null");
  }
  elements.put(pair.getName(), pair);
}

代码示例来源:origin: com.android/dx

/**
 * Put an element into the set of (name, value) pairs for this instance.
 * If there is a preexisting element with the same name, it will be
 * replaced by this method.
 *
 * @param pair {@code non-null;} the (name, value) pair to place into this instance
 */
public void put(NameValuePair pair) {
  throwIfImmutable();
  if (pair == null) {
    throw new NullPointerException("pair == null");
  }
  elements.put(pair.getName(), pair);
}

代码示例来源:origin: dragome/dragome-sdk

/**
 * Put an element into the set of (name, value) pairs for this instance.
 * If there is a preexisting element with the same name, it will be
 * replaced by this method.
 * 
 * @param pair {@code non-null;} the (name, value) pair to place into this instance
 */
public void put(NameValuePair pair) {
  throwIfImmutable();
  
  if (pair == null) {
    throw new NullPointerException("pair == null");
  }
  elements.put(pair.getName(), pair);
}

代码示例来源:origin: com.android.tools.build/builder

/**
 * Put an element into the set of (name, value) pairs for this instance.
 * If there is a preexisting element with the same name, it will be
 * replaced by this method.
 *
 * @param pair {@code non-null;} the (name, value) pair to place into this instance
 */
public void put(NameValuePair pair) {
  throwIfImmutable();
  if (pair == null) {
    throw new NullPointerException("pair == null");
  }
  elements.put(pair.getName(), pair);
}

代码示例来源:origin: gdpancheng/LoonAndroid3

/**
 * Put an element into the set of (name, value) pairs for this instance.
 * If there is a preexisting element with the same name, it will be
 * replaced by this method.
 *
 * @param pair {@code non-null;} the (name, value) pair to place into this instance
 */
public void put(NameValuePair pair) {
  throwIfImmutable();
  if (pair == null) {
    throw new NullPointerException("pair == null");
  }
  elements.put(pair.getName(), pair);
}

代码示例来源:origin: nikita36078/J2ME-Loader

/**
 * Add an element to the set of (name, value) pairs for this instance.
 * It is an error to call this method if there is a preexisting element
 * with the same name.
 *
 * @param pair {@code non-null;} the (name, value) pair to add to this instance
 */
public void add(NameValuePair pair) {
  throwIfImmutable();
  if (pair == null) {
    throw new NullPointerException("pair == null");
  }
  CstString name = pair.getName();
  if (elements.get(name) != null) {
    throw new IllegalArgumentException("name already added: " + name);
  }
  elements.put(name, pair);
}

代码示例来源:origin: com.google.dexmaker/dexmaker-dx

/**
 * Add an element to the set of (name, value) pairs for this instance.
 * It is an error to call this method if there is a preexisting element
 * with the same name.
 *
 * @param pair {@code non-null;} the (name, value) pair to add to this instance
 */
public void add(NameValuePair pair) {
  throwIfImmutable();
  if (pair == null) {
    throw new NullPointerException("pair == null");
  }
  CstString name = pair.getName();
  if (elements.get(name) != null) {
    throw new IllegalArgumentException("name already added: " + name);
  }
  elements.put(name, pair);
}

代码示例来源:origin: com.android.tools.build/builder

/**
 * Add an element to the set of (name, value) pairs for this instance.
 * It is an error to call this method if there is a preexisting element
 * with the same name.
 *
 * @param pair {@code non-null;} the (name, value) pair to add to this instance
 */
public void add(NameValuePair pair) {
  throwIfImmutable();
  if (pair == null) {
    throw new NullPointerException("pair == null");
  }
  CstString name = pair.getName();
  if (elements.get(name) != null) {
    throw new IllegalArgumentException("name already added: " + name);
  }
  elements.put(name, pair);
}

代码示例来源:origin: nikita36078/J2ME-Loader

/**
 * Helper for {@code addContents()} methods, which adds
 * contents for a particular {@link Annotation}, calling itself
 * recursively should it encounter a nested annotation.
 *
 * @param file {@code non-null;} the file to add to
 * @param annotation {@code non-null;} the annotation to add contents for
 */
public static void addContents(DexFile file, Annotation annotation) {
  TypeIdsSection typeIds = file.getTypeIds();
  StringIdsSection stringIds = file.getStringIds();
  typeIds.intern(annotation.getType());
  for (NameValuePair pair : annotation.getNameValuePairs()) {
    stringIds.intern(pair.getName());
    addContents(file, pair.getValue());
  }
}

代码示例来源:origin: gdpancheng/LoonAndroid3

/**
 * Helper for {@code addContents()} methods, which adds
 * contents for a particular {@link Annotation}, calling itself
 * recursively should it encounter a nested annotation.
 *
 * @param file {@code non-null;} the file to add to
 * @param annotation {@code non-null;} the annotation to add contents for
 */
public static void addContents(DexFile file, Annotation annotation) {
  TypeIdsSection typeIds = file.getTypeIds();
  StringIdsSection stringIds = file.getStringIds();
  typeIds.intern(annotation.getType());
  for (NameValuePair pair : annotation.getNameValuePairs()) {
    stringIds.intern(pair.getName());
    addContents(file, pair.getValue());
  }
}

代码示例来源:origin: com.android/dx

/**
 * Helper for {@code addContents()} methods, which adds
 * contents for a particular {@link Annotation}, calling itself
 * recursively should it encounter a nested annotation.
 *
 * @param file {@code non-null;} the file to add to
 * @param annotation {@code non-null;} the annotation to add contents for
 */
public static void addContents(DexFile file, Annotation annotation) {
  TypeIdsSection typeIds = file.getTypeIds();
  StringIdsSection stringIds = file.getStringIds();
  typeIds.intern(annotation.getType());
  for (NameValuePair pair : annotation.getNameValuePairs()) {
    stringIds.intern(pair.getName());
    addContents(file, pair.getValue());
  }
}

代码示例来源:origin: com.google.dexmaker/dexmaker-dx

/**
 * Helper for {@code addContents()} methods, which adds
 * contents for a particular {@link Annotation}, calling itself
 * recursively should it encounter a nested annotation.
 *
 * @param file {@code non-null;} the file to add to
 * @param annotation {@code non-null;} the annotation to add contents for
 */
public static void addContents(DexFile file, Annotation annotation) {
  TypeIdsSection typeIds = file.getTypeIds();
  StringIdsSection stringIds = file.getStringIds();
  typeIds.intern(annotation.getType());
  for (NameValuePair pair : annotation.getNameValuePairs()) {
    stringIds.intern(pair.getName());
    addContents(file, pair.getValue());
  }
}

代码示例来源:origin: com.android.tools.build/builder

/**
 * Helper for {@code addContents()} methods, which adds
 * contents for a particular {@link Annotation}, calling itself
 * recursively should it encounter a nested annotation.
 *
 * @param file {@code non-null;} the file to add to
 * @param annotation {@code non-null;} the annotation to add contents for
 */
public static void addContents(DexFile file, Annotation annotation) {
  TypeIdsSection typeIds = file.getTypeIds();
  StringIdsSection stringIds = file.getStringIds();
  typeIds.intern(annotation.getType());
  for (NameValuePair pair : annotation.getNameValuePairs()) {
    stringIds.intern(pair.getName());
    addContents(file, pair.getValue());
  }
}

代码示例来源:origin: com.jakewharton.android.repackaged/dalvik-dx

/**
 * Helper for {@code addContents()} methods, which adds
 * contents for a particular {@link Annotation}, calling itself
 * recursively should it encounter a nested annotation.
 *
 * @param file {@code non-null;} the file to add to
 * @param annotation {@code non-null;} the annotation to add contents for
 */
public static void addContents(DexFile file, Annotation annotation) {
  TypeIdsSection typeIds = file.getTypeIds();
  StringIdsSection stringIds = file.getStringIds();
  typeIds.intern(annotation.getType());
  for (NameValuePair pair : annotation.getNameValuePairs()) {
    stringIds.intern(pair.getName());
    addContents(file, pair.getValue());
  }
}

代码示例来源:origin: com.google.android.tools/dx

/**
 * Helper for {@code addContents()} methods, which adds
 * contents for a particular {@link Annotation}, calling itself
 * recursively should it encounter a nested annotation.
 *
 * @param file {@code non-null;} the file to add to
 * @param annotation {@code non-null;} the annotation to add contents for
 */
public static void addContents(DexFile file, Annotation annotation) {
  TypeIdsSection typeIds = file.getTypeIds();
  StringIdsSection stringIds = file.getStringIds();
  typeIds.intern(annotation.getType());
  for (NameValuePair pair : annotation.getNameValuePairs()) {
    stringIds.intern(pair.getName());
    addContents(file, pair.getValue());
  }
}

代码示例来源:origin: dragome/dragome-sdk

/**
 * Helper for {@code addContents()} methods, which adds
 * contents for a particular {@link Annotation}, calling itself
 * recursively should it encounter a nested annotation.
 *
 * @param file {@code non-null;} the file to add to 
 * @param annotation {@code non-null;} the annotation to add contents for
 */
public static void addContents(DexFile file, Annotation annotation) {
  TypeIdsSection typeIds = file.getTypeIds();
  StringIdsSection stringIds = file.getStringIds();
  typeIds.intern(annotation.getType());
  
  for (NameValuePair pair : annotation.getNameValuePairs()) {
    stringIds.intern(pair.getName());
    addContents(file, pair.getValue());
  }
}

代码示例来源:origin: nikita36078/J2ME-Loader

/**
 * Write a (listing file) annotation for this instance to the given
 * output, that consumes no bytes of output. This is for annotating
 * a reference to this instance at the point of the reference.
 *
 * @param out {@code non-null;} where to output to
 * @param prefix {@code non-null;} prefix for each line of output
 */
public void annotateTo(AnnotatedOutput out, String prefix) {
  out.annotate(0, prefix + "visibility: " +
      annotation.getVisibility().toHuman());
  out.annotate(0, prefix + "type: " + annotation.getType().toHuman());
  for (NameValuePair pair : annotation.getNameValuePairs()) {
    CstString name = pair.getName();
    Constant value = pair.getValue();
    out.annotate(0, prefix + name.toHuman() + ": " +
        ValueEncoder.constantToHuman(value));
  }
}

相关文章

微信公众号

最新文章

更多