当前位置: 首页>>代码示例>>Java>>正文


Java JsonAnyGetter类代码示例

本文整理汇总了Java中org.codehaus.jackson.annotate.JsonAnyGetter的典型用法代码示例。如果您正苦于以下问题:Java JsonAnyGetter类的具体用法?Java JsonAnyGetter怎么用?Java JsonAnyGetter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JsonAnyGetter类属于org.codehaus.jackson.annotate包,在下文中一共展示了JsonAnyGetter类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getField

import org.codehaus.jackson.annotate.JsonAnyGetter; //导入依赖的package包/类
/**
 * Return the value for the field with a given name and type.
 * 
 * @param field
 *        The name of the field to retrieve the value of.
 * @param extensionFieldType
 *        The type of the field.
 * @return The value for the field with the given name.
 * @throws NoSuchElementException
 *         if this schema does not contain a field of the given name.
 * @throws IllegalArgumentException
 *         if the given field is null or an empty string or if the extensionFieldType is null.
 */
@JsonAnyGetter
public <T> T getField(String field, ExtensionFieldType<T> extensionFieldType) {
    if (field == null || field.isEmpty()) {
        throw new IllegalArgumentException("Invalid field name");
    }
    if (extensionFieldType == null) {
        throw new IllegalArgumentException("Invalid field type");
    }

    if (!isFieldPresent(field)) {
        throw new NoSuchElementException("Field " + field + " not valid in this extension");
    }

    return extensionFieldType.fromString(fields.get(field).value);
}
 
开发者ID:AgarwalNeha1,项目名称:gluu,代码行数:29,代码来源:Extension.java

示例2: jsonVerbatimFields

import org.codehaus.jackson.annotate.JsonAnyGetter; //导入依赖的package包/类
/**
 * This private method is only for serialization via jackson and not exposed anywhere else!
 * It maps the verbatimField terms into properties with their full qualified name.
 */
@JsonAnyGetter
private Map<String, String> jsonVerbatimFields() {
  Map<String, String> extendedProps = Maps.newHashMap();
  for (Map.Entry<Term, String> prop : fields.entrySet()) {
    extendedProps.put(prop.getKey().qualifiedName(), prop.getValue());
  }
  return extendedProps;
}
 
开发者ID:gbif,项目名称:gbif-api,代码行数:13,代码来源:VerbatimNameUsage.java

示例3: jsonVerbatimFields

import org.codehaus.jackson.annotate.JsonAnyGetter; //导入依赖的package包/类
/**
 * This private method is only for serialization via jackson and not exposed anywhere else!
 * It maps the verbatimField terms into properties with their full qualified name.
 */
@JsonAnyGetter
private Map<String, String> jsonVerbatimFields() { // note: for 1.6.0 MUST use non-getter name; otherwise doesn't matter
  Map<String, String> extendedProps = Maps.newHashMap();
  for (Map.Entry<Term, String> prop : verbatimFields.entrySet()) {
    extendedProps.put(prop.getKey().qualifiedName(), prop.getValue());
  }
  return extendedProps;
}
 
开发者ID:gbif,项目名称:gbif-api,代码行数:13,代码来源:VerbatimOccurrence.java

示例4: jsonVerbatimFields

import org.codehaus.jackson.annotate.JsonAnyGetter; //导入依赖的package包/类
/**
 * This private method is only for serialization via jackson and not exposed anywhere else!
 * It maps the verbatimField terms into properties with their simple name or qualified names for UnknownTerms.
 */
@JsonAnyGetter
private Map<String, String> jsonVerbatimFields() {
  Map<String, String> extendedProps = Maps.newHashMap();
  for (Map.Entry<Term, String> prop : getVerbatimFields().entrySet()) {
    Term t = prop.getKey();
    if (t instanceof UnknownTerm || PROPERTIES.contains(t.simpleName())) {
      extendedProps.put(t.qualifiedName(), prop.getValue());
    } else {
      // render all terms in controlled enumerations as simple names only - unless we have a property of that name already!
      extendedProps.put(t.simpleName(), prop.getValue());
    }
  }
  return extendedProps;
}
 
开发者ID:gbif,项目名称:gbif-api,代码行数:19,代码来源:Occurrence.java

示例5: anyGetter

import org.codehaus.jackson.annotate.JsonAnyGetter; //导入依赖的package包/类
@Override
public void anyGetter(JMethod getter) {
    getter.annotate(JsonAnyGetter.class);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:Jackson1Annotator.java

示例6: getAdditionalProperties

import org.codehaus.jackson.annotate.JsonAnyGetter; //导入依赖的package包/类
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
    return this.additionalProperties;
}
 
开发者ID:jestevez,项目名称:ethereum-java-wallet,代码行数:5,代码来源:Result.java

示例7: getAny

import org.codehaus.jackson.annotate.JsonAnyGetter; //导入依赖的package包/类
/**
 * @return the map for holding unspecified (user) attributes
 */
@XmlAnyAttribute
@JsonAnyGetter
public Map<QName,Object> getAny() {
  return attrs;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:ColumnSchemaModel.java


注:本文中的org.codehaus.jackson.annotate.JsonAnyGetter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。