本文整理匯總了Java中net.nuagenetworks.bambou.annotation.RestEntity類的典型用法代碼示例。如果您正苦於以下問題:Java RestEntity類的具體用法?Java RestEntity怎麽用?Java RestEntity使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RestEntity類屬於net.nuagenetworks.bambou.annotation包,在下文中一共展示了RestEntity類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
示例5: getRestName
import net.nuagenetworks.bambou.annotation.RestEntity; //導入依賴的package包/類
@JsonIgnore
protected static String getRestName(Class<?> restObjClass) {
RestEntity annotation = restObjClass.getAnnotation(RestEntity.class);
return annotation.restName();
}