/**
* 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);
}
java类org.codehaus.jackson.annotate.JsonAnyGetter的实例源码
Extension.java 文件源码
项目:gluu
阅读 28
收藏 0
点赞 0
评论 0
VerbatimNameUsage.java 文件源码
项目:gbif-api
阅读 20
收藏 0
点赞 0
评论 0
/**
* 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;
}
VerbatimOccurrence.java 文件源码
项目:gbif-api
阅读 19
收藏 0
点赞 0
评论 0
/**
* 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;
}
Occurrence.java 文件源码
项目:gbif-api
阅读 24
收藏 0
点赞 0
评论 0
/**
* 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;
}
Jackson1Annotator.java 文件源码
项目:GitHub
阅读 21
收藏 0
点赞 0
评论 0
@Override
public void anyGetter(JMethod getter) {
getter.annotate(JsonAnyGetter.class);
}
Result.java 文件源码
项目:ethereum-java-wallet
阅读 22
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
Transactions.java 文件源码
项目:ethereum-java-wallet
阅读 21
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
ColumnSchemaModel.java 文件源码
项目:ditb
阅读 23
收藏 0
点赞 0
评论 0
/**
* @return the map for holding unspecified (user) attributes
*/
@XmlAnyAttribute
@JsonAnyGetter
public Map<QName,Object> getAny() {
return attrs;
}
TableSchemaModel.java 文件源码
项目:ditb
阅读 26
收藏 0
点赞 0
评论 0
/**
* @return the map for holding unspecified (user) attributes
*/
@XmlAnyAttribute
@JsonAnyGetter
public Map<QName,Object> getAny() {
return attrs;
}
RegReportRq.java 文件源码
项目:skygiraffe-slackbot
阅读 16
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
ParametersMainRq.java 文件源码
项目:skygiraffe-slackbot
阅读 18
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
Parameter.java 文件源码
项目:skygiraffe-slackbot
阅读 25
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
Datum.java 文件源码
项目:skygiraffe-slackbot
阅读 20
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
Action.java 文件源码
项目:skygiraffe-slackbot
阅读 28
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
Row.java 文件源码
项目:skygiraffe-slackbot
阅读 26
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
Parameter.java 文件源码
项目:skygiraffe-slackbot
阅读 23
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
WritebackRq.java 文件源码
项目:skygiraffe-slackbot
阅读 20
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
WBData.java 文件源码
项目:skygiraffe-slackbot
阅读 17
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
WritebackStatus.java 文件源码
项目:skygiraffe-slackbot
阅读 18
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
CheckWriteBackRq.java 文件源码
项目:skygiraffe-slackbot
阅读 17
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
ActionDataRq.java 文件源码
项目:skygiraffe-slackbot
阅读 18
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
ParametrizedReportRequest.java 文件源码
项目:skygiraffe-slackbot
阅读 17
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
Team.java 文件源码
项目:skygiraffe-slackbot
阅读 23
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
Action.java 文件源码
项目:skygiraffe-slackbot
阅读 23
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
Payload.java 文件源码
项目:skygiraffe-slackbot
阅读 27
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
TokenResponse.java 文件源码
项目:skygiraffe-slackbot
阅读 16
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
SlackResponse.java 文件源码
项目:skygiraffe-slackbot
阅读 19
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
User.java 文件源码
项目:skygiraffe-slackbot
阅读 17
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
IntMessageRequest.java 文件源码
项目:skygiraffe-slackbot
阅读 20
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
Attachment.java 文件源码
项目:skygiraffe-slackbot
阅读 20
收藏 0
点赞 0
评论 0
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}