use of javax.xml.bind.annotation.XmlTransient in project candlepin by candlepin.
the class Product method getSkuDisabledContentIds.
@XmlTransient
public List<String> getSkuDisabledContentIds() {
List<String> skus = new LinkedList<>();
String attrib = this.getAttributeValue(Attributes.CONTENT_OVERRIDE_DISABLED);
if (attrib != null && !attrib.isEmpty()) {
StringTokenizer tokenizer = new StringTokenizer(attrib, ",");
while (tokenizer.hasMoreElements()) {
skus.add((String) tokenizer.nextElement());
}
}
return skus;
}
use of javax.xml.bind.annotation.XmlTransient in project winery by eclipse.
the class TEntityType method getWinerysPropertiesDefinition.
/**
* This is a special method for Winery. Winery allows to define a property definition by specifying name/type
* values. Instead of parsing the extensible elements returned TDefinitions, this method is a convenience method to
* access this information
*
* @return a WinerysPropertiesDefinition object, which includes a map of name/type-pairs denoting the associated
* property definitions. A default element name and namespace is added if it is not defined in the underlying XML.
* null if no Winery specific KV properties are defined for the given entity type
*/
@XmlTransient
@JsonIgnore
public WinerysPropertiesDefinition getWinerysPropertiesDefinition() {
if (properties == null || !(properties instanceof WinerysPropertiesDefinition)) {
return null;
}
WinerysPropertiesDefinition res = (WinerysPropertiesDefinition) properties;
// we put defaults if element name and namespace have not been set
if (res.getElementName() == null) {
res.setElementName("Properties");
}
if (res.getNamespace() == null) {
// we use the target namespace of the original element
String ns = this.getTargetNamespace();
if (!ns.endsWith("/")) {
ns += "/";
}
ns += NS_SUFFIX_PROPERTIES_DEFINITION_WINERY;
res.setNamespace(ns);
}
return res;
}
use of javax.xml.bind.annotation.XmlTransient in project cxf by apache.
the class JAXBContextInitializer method isMethodAccepted.
/**
* Checks if the method is accepted as a JAXB property getter.
*/
static boolean isMethodAccepted(Method method, XmlAccessType accessType) {
// We only accept non static property getters which are not marked @XmlTransient
if (Modifier.isStatic(method.getModifiers()) || method.isAnnotationPresent(XmlTransient.class) || !Modifier.isPublic(method.getModifiers()) || "getClass".equals(method.getName())) {
return false;
}
// must not have parameters and return type must not be void
if (method.getReturnType() == Void.class || method.getReturnType() == Void.TYPE || method.getParameterTypes().length != 0 || (method.getDeclaringClass().equals(Throwable.class) && !("getMessage".equals(method.getName()))) || !(method.getName().startsWith("get") || method.getName().startsWith("is"))) {
return false;
}
int beginIndex = 3;
if (method.getName().startsWith("is")) {
beginIndex = 2;
}
Method setter = null;
try {
setter = method.getDeclaringClass().getMethod("set" + method.getName().substring(beginIndex), new Class[] { method.getReturnType() });
} catch (Exception e) {
// getter, but no setter
}
if (setter != null) {
if (setter.isAnnotationPresent(XmlTransient.class) || !Modifier.isPublic(setter.getModifiers())) {
return false;
}
} else if (!Collection.class.isAssignableFrom(method.getReturnType()) && !Throwable.class.isAssignableFrom(method.getDeclaringClass())) {
// not an Exception,
return false;
}
if (accessType == XmlAccessType.NONE || accessType == XmlAccessType.FIELD) {
return checkJaxbAnnotation(method.getAnnotations());
}
return true;
}
use of javax.xml.bind.annotation.XmlTransient in project candlepin by candlepin.
the class Product method getSkuEnabledContentIds.
@XmlTransient
public List<String> getSkuEnabledContentIds() {
List<String> skus = new LinkedList<>();
String attrib = this.getAttributeValue(Attributes.CONTENT_OVERRIDE_ENABLED);
if (attrib != null && !attrib.isEmpty()) {
StringTokenizer tokenizer = new StringTokenizer(attrib, ",");
while (tokenizer.hasMoreElements()) {
skus.add((String) tokenizer.nextElement());
}
}
return skus;
}
use of javax.xml.bind.annotation.XmlTransient in project candlepin by candlepin.
the class User method getPermissions.
/**
* Full list of permissions for this user.
*
* Includes those from roles stored in the database, as well as those explicitly added
* by the user service adapter.
*
* @return full list of permissions for this user.
*/
@XmlTransient
public Set<Permission> getPermissions() {
PermissionFactory permFactory = new PermissionFactory();
Set<Permission> perms = new HashSet<>();
for (Role r : getRoles()) {
perms.addAll(permFactory.createPermissions(this, r.getPermissions()));
}
perms.addAll(this.permissions);
return perms;
}
Aggregations