javax.xml.bind.annotation.XmlElementWrapper Java Examples

The following examples show how to use javax.xml.bind.annotation.XmlElementWrapper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MCRUser.java    From mycore with GNU General Public License v3.0 6 votes vote down vote up
@Transient
@XmlElementWrapper(name = "roles")
@XmlElement(name = "role")
private MCRRole[] getRoles() {
    if (getSystemRoleIDs().isEmpty() && getExternalRoleIDs().isEmpty()) {
        return null;
    }
    ArrayList<String> roleIds = new ArrayList<>(getSystemRoleIDs().size() + getExternalRoleIDs().size());
    Collection<MCRRole> roles = new ArrayList<>(roleIds.size());
    roleIds.addAll(getSystemRoleIDs());
    roleIds.addAll(getExternalRoleIDs());
    for (String roleName : roleIds) {
        MCRRole role = MCRRoleManager.getRole(roleName);
        if (role == null) {
            throw new MCRException("Could not load role: " + roleName);
        }
        roles.add(role);
    }
    return roles.toArray(new MCRRole[roles.size()]);
}
 
Example #2
Source File: Job.java    From hyperjaxb3 with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@XmlElementWrapper(name = "tasks", namespace = "urn:test")
@XmlElements( {
		@XmlElement(name = "usertask", namespace = "urn:test", type = UserTask.class),
		@XmlElement(name = "autotask", namespace = "urn:test", type = AutoTask.class) })
public Collection<Node> getNodes() {
	return nodes;
}
 
Example #3
Source File: ResourceSupport.java    From container with Apache License 2.0 5 votes vote down vote up
/**
 * Returns all {@link Link}s contained in this resource.
 */
@XmlElement(name = "Link")
@XmlElementWrapper(name = "Links")
@XmlJavaTypeAdapter(Link.JaxbAdapter.class)
@JsonProperty("_links")
public List<Link> getLinks() {
    if (links.isEmpty()) {
        return null;
    }

    return this.links;
}
 
Example #4
Source File: DirectoryScannerConfig.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Getter for property excludeFiles.
 * This is an array of filters identifying files that should be excluded.
 * A file is excluded if at least one filter matches.
 * @return Value of property excludeFiles.
 */
@XmlElementWrapper(name="ExcludeFiles",
        namespace=XmlConfigUtils.NAMESPACE)
@XmlElementRef
public FileMatch[] getExcludeFiles() {
    synchronized(excludeFiles) {
        return excludeFiles.toArray(new FileMatch[0]);
    }
}
 
Example #5
Source File: DirectoryScannerConfig.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Getter for property includeFiles.
 * This is an array of filters identifying files that should be selected.
 * A file is selected if at least one filter matches.
 * @return Value of property includeFiles.
 */
@XmlElementWrapper(name="IncludeFiles",
        namespace=XmlConfigUtils.NAMESPACE)
@XmlElementRef
public FileMatch[] getIncludeFiles() {
    synchronized(includeFiles) {
        return includeFiles.toArray(new FileMatch[0]);
    }
}
 
Example #6
Source File: ERPropertyInfoImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public ERPropertyInfoImpl(ClassInfoImpl<TypeT, ClassDeclT, FieldT, MethodT> classInfo, PropertySeed<TypeT, ClassDeclT, FieldT, MethodT> propertySeed) {
    super(classInfo, propertySeed);

    XmlElementWrapper e = seed.readAnnotation(XmlElementWrapper.class);

    boolean nil = false;
    boolean required = false;
    if(!isCollection()) {
        xmlName = null;
        if(e!=null)
            classInfo.builder.reportError(new IllegalAnnotationException(
                Messages.XML_ELEMENT_WRAPPER_ON_NON_COLLECTION.format(
                    nav().getClassName(parent.getClazz())+'.'+seed.getName()),
                e
            ));
    } else {
        if(e!=null) {
            xmlName = calcXmlName(e);
            nil = e.nillable();
            required = e.required();
        } else
            xmlName = null;
    }

    wrapperNillable = nil;
    wrapperRequired = required;
}
 
Example #7
Source File: ClassificationImpl.java    From windup with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * This gives all quickfixes for classification
 *
 * @return all quickfixes
 */
@Override
@XmlElementWrapper(name = "quickfixes")
@XmlElement(name = "quickfix", type = QuickfixImpl.class)
public List<Quickfix> getQuickfixes()
{
    return quickfixes;
}
 
Example #8
Source File: DirectoryScannerConfig.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Getter for property excludeFiles.
 * This is an array of filters identifying files that should be excluded.
 * A file is excluded if at least one filter matches.
 * @return Value of property excludeFiles.
 */
@XmlElementWrapper(name="ExcludeFiles",
        namespace=XmlConfigUtils.NAMESPACE)
@XmlElementRef
public FileMatch[] getExcludeFiles() {
    synchronized(excludeFiles) {
        return excludeFiles.toArray(new FileMatch[0]);
    }
}
 
Example #9
Source File: PropertyInfoImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Computes the tag name from a {@link XmlElementWrapper} by taking the defaulting into account.
 */
protected final QName calcXmlName(XmlElementWrapper e) {
    if(e!=null)
        return calcXmlName(e.namespace(),e.name());
    else
        return calcXmlName("##default","##default");
}
 
Example #10
Source File: PropertyInfoImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Computes the tag name from a {@link XmlElementWrapper} by taking the defaulting into account.
 */
protected final QName calcXmlName(XmlElementWrapper e) {
    if(e!=null)
        return calcXmlName(e.namespace(),e.name());
    else
        return calcXmlName("##default","##default");
}
 
Example #11
Source File: CountryService.java    From rice with Educational Community License v2.0 5 votes vote down vote up
/**
 * Returns all Countries
 *
 * @return all countries
 */
@WebMethod(operationName = "findAllCountries")
@XmlElementWrapper(name = "countries", required = false)
@XmlElement(name = "country", required = false)
@WebResult(name = "countries")
@Cacheable(value=Country.Cache.NAME, key="'all'")
List<Country> findAllCountries();
 
Example #12
Source File: JaxbBatchRequest.java    From documentum-rest-client-java with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@XmlElementWrapper
@XmlElement(name = "attachment", type = JaxbBatchAttachment.class)
public List<Attachment> getAttachments() {
    return (List)attachments;
}
 
Example #13
Source File: RelatedContentImpl.java    From Asqatasun with GNU Affero General Public License v3.0 5 votes vote down vote up
@XmlElementWrapper
@XmlElementRefs({
    @XmlElementRef(type = org.asqatasun.entity.audit.SSPImpl.class)})
@XmlTransient
@Override
public Set<Content> getParentContentSet() {
    return (Set)parentContentSet;
}
 
Example #14
Source File: MCRViewerConfiguration.java    From mycore with GNU General Public License v3.0 5 votes vote down vote up
@XmlElements({ @XmlElement(name = "resource") })
@XmlElementWrapper(name = "resources")
public final List<MCRIViewClientResource> getResources() {
    return resources.entries()
        .stream()
        .map(entry -> new MCRIViewClientResource(entry.getKey(), entry.getValue()))
        .collect(Collectors.toList());
}
 
Example #15
Source File: NamespaceService.java    From rice with Educational Community License v2.0 5 votes vote down vote up
/**
 * Returns all Namespaces.
 *
 * @return all namespaces
 */
@WebMethod(operationName = "findAllNamespaces")
@WebResult(name = "namespaces")
@XmlElementWrapper(name = "namespaces", required = true)
@XmlElement(name = "namespace", required = false)
@Cacheable(value=Namespace.Cache.NAME, key="'all'")
List<Namespace> findAllNamespaces();
 
Example #16
Source File: FilterInfo.java    From libreveris with GNU Lesser General Public License v3.0 5 votes vote down vote up
@XmlElementWrapper(name = "elements")
@XmlElement(name = "element")
private ElemInfo[] getElems ()
{
    if (elements == null) {
        return null;
    } else {
        return elements.values().toArray(
                new ElemInfo[elements.size()]);
    }
}
 
Example #17
Source File: CampusService.java    From rice with Educational Community License v2.0 5 votes vote down vote up
/**
 * This will return all {@link CampusType}.
 */
@WebMethod(operationName="findAllCampusTypes")
@XmlElementWrapper(name = "campusTypes", required = false)
@XmlElement(name = "campusType", required = false)
@WebResult(name = "campusTypes")
@Cacheable(value=CampusType.Cache.NAME, key="'all'")
List<CampusType> findAllCampusTypes();
 
Example #18
Source File: MUCRoomEntity.java    From REST-API-Client with Apache License 2.0 4 votes vote down vote up
@XmlElementWrapper(name = "outcasts")
@XmlElement(name = "outcast")
public List<String> getOutcasts() {
    return outcasts;
}
 
Example #19
Source File: PdbxStructAssemblyGenXMLContainer.java    From biojava with GNU Lesser General Public License v2.1 4 votes vote down vote up
@XmlElementWrapper
public List<PdbxStructAssemblyGen> getPdbxStructAssemblyGens(){
	return data;

}
 
Example #20
Source File: Server.java    From ldap-in-memory with Apache License 2.0 4 votes vote down vote up
@XmlElementWrapper(name="listeners", required = true)
@XmlElement(name="listener", required = true)
public void setListeners(List<Listener> listeners) {
    this.listeners = listeners;
}
 
Example #21
Source File: XmlLog.java    From phoebus with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Getter for log's XmlLogbooks.
 *
 * @return XmlLogbooks
 */
@XmlElementWrapper(name = "logbooks")
@XmlElement(name = "logbook")
public Collection<XmlLogbook> getXmlLogbooks() {
    return logbooks;
}
 
Example #22
Source File: XmlLog.java    From phoebus with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Getter for log's XmlProperties.
 *
 * @return properties XmlProperties
 */
@XmlElementWrapper(name = "properties")
@XmlElement(name = "property")
public Collection<XmlProperty> getXmlProperties() {
    return properties;
}
 
Example #23
Source File: SpoonModel.java    From spoon-maven-plugin with GNU Lesser General Public License v3.0 4 votes vote down vote up
@XmlElementWrapper(name = "templates")
@XmlElement(name = "template")
public void setTemplates(List<String> templates) {
	this.templates = templates;
}
 
Example #24
Source File: JAXBWidgetType.java    From entando-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
@XmlElement(name = "title", required = false)
   @XmlElementWrapper(name = "titles", required = false)
public ApsProperties getTitles() {
	return _titles;
}
 
Example #25
Source File: CategoryRO.java    From yes-cart with Apache License 2.0 4 votes vote down vote up
@XmlElementWrapper(name = "breadcrumbs")
@XmlElement(name = "breadcrumb")
public List<BreadcrumbRO> getBreadcrumbs() {
    return breadcrumbs;
}
 
Example #26
Source File: CustomProperty.java    From oxAuth with MIT License 4 votes vote down vote up
@XmlElementWrapper(name = "values")
@XmlElement(name = "value")
public List<String> getValues() {
	return this.values;
}
 
Example #27
Source File: RESTOutputUser.java    From geofence with GNU General Public License v2.0 4 votes vote down vote up
@XmlElementWrapper(name="groups")
@XmlElement(name="group")
public List<IdName> getGroups() {
    return groups;
}
 
Example #28
Source File: JaxbLifecycle.java    From documentum-rest-client-java with Apache License 2.0 4 votes vote down vote up
@XmlElementWrapper(name="alias-sets")
@XmlElement(name="alias-set")
public List<String> getAliasSets() {
    return aliasSets;
}
 
Example #29
Source File: JaxbLifecycle.java    From documentum-rest-client-java with Apache License 2.0 4 votes vote down vote up
@XmlElementWrapper
@XmlElement(name="state", type=JaxbLifecycleState.class)
public List<LifecycleState> getStates() {
    return states;
}
 
Example #30
Source File: JaxbSearch.java    From documentum-rest-client-java with Apache License 2.0 4 votes vote down vote up
@XmlElementWrapper
@XmlElement(name = "type")
public List<String> getTypes() {
    return types;
}