本文整理匯總了Java中net.nuagenetworks.bambou.annotation.RestEntity.resourceName方法的典型用法代碼示例。如果您正苦於以下問題:Java RestEntity.resourceName方法的具體用法?Java RestEntity.resourceName怎麽用?Java RestEntity.resourceName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.nuagenetworks.bambou.annotation.RestEntity
的用法示例。
在下文中一共展示了RestEntity.resourceName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getResourceUrl
import net.nuagenetworks.bambou.annotation.RestEntity; //導入方法依賴的package包/類
@JsonIgnore
protected String getResourceUrl(RestSession<?> session) {
// Get the object's resource name
RestEntity annotation = getClass().getAnnotation(RestEntity.class);
String resourceName = annotation.resourceName();
// Build the base URL
String url = session.getRestBaseUrl();
// Build the complete URL for the specified object
if (id != null) {
return String.format("%s/%s/%s", url, resourceName, id);
} else {
return String.format("%s/%s", url, resourceName);
}
}
示例2: getResourceUrl
import net.nuagenetworks.bambou.annotation.RestEntity; //導入方法依賴的package包/類
protected String getResourceUrl(RestSession<?> session) {
// Get the object's resource name
RestEntity annotation = getClass().getAnnotation(RestEntity.class);
String resourceName = annotation.resourceName();
// Build the base URL
String url = session.getRestBaseUrl();
return String.format("%s/%s", url, resourceName);
}
示例3: getResourceUrlForChildType
import net.nuagenetworks.bambou.annotation.RestEntity; //導入方法依賴的package包/類
protected String getResourceUrlForChildType(RestSession<?> session, Class<?> childRestObjClass) {
// Get the child object's resource name
RestEntity annotation = childRestObjClass.getAnnotation(RestEntity.class);
String resourceName = annotation.resourceName();
return String.format("%s/%s", session.getRestBaseUrl(), resourceName);
}
示例4: getResourceUrlForChildType
import net.nuagenetworks.bambou.annotation.RestEntity; //導入方法依賴的package包/類
@JsonIgnore
protected String getResourceUrlForChildType(RestSession<?> session, Class<?> childRestObjClass) {
// Get the child object's resource name
RestEntity annotation = childRestObjClass.getAnnotation(RestEntity.class);
String childResourceName = annotation.resourceName();
return String.format("%s/%s", getResourceUrl(session), childResourceName);
}