Java 类javax.xml.bind.annotation.XmlElementWrapper 实例源码

项目:openjdk-jdk10    文件:TypeInfo.java   
public TypeInfo getItemType() {
        if (type instanceof Class && ((Class)type).isArray() && !byte[].class.equals(type)) {
            Type componentType = ((Class)type).getComponentType();
            Type genericComponentType = null;
            if (genericType!= null && genericType instanceof GenericArrayType) {
                GenericArrayType arrayType = (GenericArrayType) type;
                genericComponentType = arrayType.getGenericComponentType();
                componentType = arrayType.getGenericComponentType();
            }
            TypeInfo ti =new TypeInfo(tagName, componentType, annotations);
            if (genericComponentType != null) ti.setGenericType(genericComponentType);
            for(Annotation anno : annotations) if (anno instanceof XmlElementWrapper) ti.wrapperType = this;
            return ti;
        }
//        if (type instanceof Class && java.util.Collection.class.isAssignableFrom((Class)type)) {
        Type t = (genericType != null)? genericType : type;
        Type base = Utils.REFLECTION_NAVIGATOR.getBaseClass(t, Collection.class);
        if ( base != null)  {
            return new TypeInfo(tagName, Utils.REFLECTION_NAVIGATOR.getTypeArgument(base,0), annotations);
        }
        return null;
    }
项目:mycore    文件:MCRUser.java   
@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()]);
}
项目:mycore    文件:MCRUser.java   
@Transient
@XmlElementWrapper(name = "attributes")
@XmlElement(name = "attribute")
private MapEntry[] getAttributesMap() {
    if (attributes == null) {
        return null;
    }
    ArrayList<MapEntry> list = new ArrayList<>(attributes.size());
    for (Entry<String, String> entry : attributes.entrySet()) {
        MapEntry mapEntry = new MapEntry();
        mapEntry.name = entry.getKey();
        mapEntry.value = entry.getValue();
        list.add(mapEntry);
    }
    return list.toArray(new MapEntry[list.size()]);
}
项目:AgentWorkbench    文件:Project.java   
/**
 * Gets the list of simulation setups.
 * @return the simulation setups
 */
@XmlElementWrapper(name = "simulationSetups")
public SimulationSetups getSimulationSetups() {
    if (this.simulationSetups == null) {
        this.simulationSetups = new SimulationSetups(this, this.getSimulationSetupCurrent());
    }
    return this.simulationSetups;
}
项目:OpenJSharp    文件:ERPropertyInfoImpl.java   
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;
}
项目:OpenJSharp    文件:PropertyInfoImpl.java   
/**
 * 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");
}
项目:stroom-query    文件:Key.java   
@XmlElementWrapper(name = "values")
@XmlElements({
        @XmlElement(name = "byte", type = Byte.class),
        @XmlElement(name = "double", type = Double.class),
        @XmlElement(name = "float", type = Float.class),
        @XmlElement(name = "short", type = Short.class),
        @XmlElement(name = "integer", type = Integer.class),
        @XmlElement(name = "long", type = Long.class),
        @XmlElement(name = "string", type = String.class)
})
public List<Object> getValues() {
    return values;
}
项目:jdk8u-jdk    文件:DirectoryScannerConfig.java   
/**
 * 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]);
    }
}
项目:jdk8u-jdk    文件:DirectoryScannerConfig.java   
/**
 * 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]);
    }
}
项目:openjdk-jdk10    文件:ERPropertyInfoImpl.java   
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;
}
项目:openjdk-jdk10    文件:PropertyInfoImpl.java   
/**
 * 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");
}
项目:openjdk9    文件:DirectoryScannerConfig.java   
/**
 * 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]);
    }
}
项目:openjdk9    文件:ERPropertyInfoImpl.java   
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;
}
项目:ibas-framework    文件:Serializer.java   
private List<SchemaElement> getSerializedElements(Field[] fields) {
    List<SchemaElement> elements = new ArrayList<>();
    for (Field field : fields) {
        Class<?> elementType = field.getType();
        String elementName = field.getName();
        String wrapperName = null;
        XmlElementWrapper xmlWrapper = field.getAnnotation(XmlElementWrapper.class);
        if (xmlWrapper != null) {
            // 首先判断是否为数组元素
            wrapperName = xmlWrapper.name();
        }
        XmlElement xmlElement = field.getAnnotation(XmlElement.class);
        if (xmlElement != null) {
            if (!xmlElement.name().equals("##default")) {
                elementName = xmlElement.name();
            }
            if (xmlElement.type() != null && !xmlElement.type().getName().startsWith(XmlElement.class.getName())) {
                elementType = xmlElement.type();
            }
        } else {
            continue;
        }
        if (elementName == null) {
            continue;
        }
        if (elementType == null) {
            continue;
        }
        elements.add(new SchemaElement(elementName, wrapperName, elementType));
    }
    return elements;
}
项目:REST    文件:CAgentContainer.java   
/**
 * returns the running plans
 *
 * @return list with running plans
 */
@Nonnull
@XmlElementWrapper( name = "runningplans" )
@XmlElement( name = "runningplan" )
public final List<ITerm> getRunningplan()
{
    return m_runningplan;
}
项目:ibas-framework    文件:OperationResult.java   
@Override
@XmlElementWrapper(name = "ResultObjects")
@XmlElement(name = "ResultObject")
public final ArrayList<P> getResultObjects() {
    if (this.resultObjects == null) {
        this.resultObjects = new ArrayList<P>();
    }
    return this.resultObjects;
}
项目:ibas-framework    文件:OperationResult.java   
@Override
@XmlElementWrapper(name = "Informations")
@XmlElement(name = "Information", type = OperationInformation.class)
public final ArrayList<IOperationInformation> getInformations() {
    if (this.informations == null) {
        this.informations = new ArrayList<IOperationInformation>();
    }
    return this.informations;
}
项目:ibas-framework    文件:Criteria.java   
@Override
@XmlElementWrapper(name = "Conditions")
@XmlElement(name = "Condition", type = Condition.class)
public final IConditions getConditions() {
    if (this.conditions == null) {
        this.conditions = new Conditions();
    }
    return this.conditions;
}
项目:ibas-framework    文件:Criteria.java   
@Override
@XmlElementWrapper(name = "ChildCriterias")
@XmlElement(name = "ChildCriteria", type = ChildCriteria.class, nillable = true)
public final IChildCriterias getChildCriterias() {
    if (this.childCriterias == null) {
        this.childCriterias = new ChildCriterias();
    }
    return this.childCriterias;
}
项目:lookaside_java-1.8.0-openjdk    文件:DirectoryScannerConfig.java   
/**
 * 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]);
    }
}
项目:biomedicus    文件:CasMappings.java   
/**
 * Gets the mappings from rtf destinations to UIMA CAS views.
 *
 * @return list of the mappings.
 */
@XmlElementWrapper(required = true)
@XmlElementRef(name = "destinationCasMapping")
@Nullable
public List<DestinationCasMapping> getDestinationCasMappings() {
  return destinationCasMappings;
}
项目:mycore    文件:MCRViewerConfiguration.java   
@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());
}
项目:documentum-rest-client-java    文件:JaxbSearchTemplate.java   
@XmlElementWrapper(name = "external-variables")
@XmlElements({@XmlElement(name="property-list-variable", type=JaxbPropertyListVariable.class),
    @XmlElement(name="relative-date-variable", type=JaxbRelativeDateVariable.class),
    @XmlElement(name="property-variable", type=JaxbPropertyValueVariable.class),
    @XmlElement(name="fulltext-variable", type=JaxbFullTextVariable.class)})
@Override
public List<ExternalVariable<?>> getExternalVariables() {
    return externalVariables;
}
项目:cloudkeeper    文件:MutableOverride.java   
@XmlElementWrapper(name = "targets")
@XmlElements({
    @XmlElement(type = JAXBAdapters.JAXBElementPatternTarget.class, name = "element-regex"),
    @XmlElement(type = JAXBAdapters.JAXBElementTarget.class, name = "element"),
    @XmlElement(type = JAXBAdapters.JAXBExecutionTracePatternTarget.class, name = "execution-trace-regex"),
    @XmlElement(type = JAXBAdapters.JAXBExecutionTraceTarget.class, name = "execution-trace")
})
@Override
public List<MutableOverrideTarget<?>> getTargets() {
    return overrideTargets;
}
项目:cloudkeeper    文件:MutableParentModule.java   
@XmlElementWrapper(name = "connections")
@XmlElements({
    @XmlElement(type = MutableSiblingConnection.class, name = "sibling-connection"),
    @XmlElement(type = MutableParentInToChildInConnection.class, name = "parent-to-child-connection"),
    @XmlElement(type = MutableChildOutToParentOutConnection.class, name = "child-to-parent-connection"),
    @XmlElement(type = MutableShortCircuitConnection.class, name = "short-circuit-connection")
})
@Override
public final List<MutableConnection<?>> getConnections() {
    return connections;
}
项目:lookaside_java-1.8.0-openjdk    文件:PropertyInfoImpl.java   
/**
 * 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");
}
项目:framework    文件:SendPicsInfo.java   
@XmlElementWrapper(name = "PicList")
@XmlElement(name = "item")
public List<Item> getItem() {
    return item;
}
项目:framework    文件:WechatResponse.java   
@XmlElementWrapper(name = "Articles")
@XmlElement(name = "item")
public List<ArticleResponse> getArticle() {
    return article;
}
项目:microprofile-open-api    文件:Pet.java   
@XmlElementWrapper(name = "photoUrls")
@XmlElement(name = "photoUrl", required = true)
public List<String> getPhotoUrls() {
    return photoUrls;
}
项目:microprofile-open-api    文件:Pet.java   
@XmlElementWrapper(name = "tags")
@XmlElement(name = "tag")
public List<Tag> getTags() {
    return tags;
}
项目:oscm    文件:RoleBasedFilterConfigEntry.java   
@XmlElementWrapper(name = "rolesAllowed")
@XmlElement(name="role")
public Set<String> getRolesAllowed() {
    return rolesAllowed;
}
项目:NMapGUI    文件:Script.java   
@XmlElementWrapper(name="categories", required=false)
@XmlElement(name="category", required=false)
public List<String> getCategories() {
    return categories;
}
项目:NMapGUI    文件:Host.java   
@XmlElementWrapper(name="hostnames", required=false)
@XmlElement(name="hostname", required=false)
public Set<Hostname> getHostNames() {
    return hostNames;
}
项目:NMapGUI    文件:Host.java   
@XmlElementWrapper(name="trace")
@XmlElement(name="hop")
public LinkedList<Hop> getTrace() {
    return trace;
}
项目:NMapGUI    文件:Host.java   
@XmlElementWrapper(name="ports")
@XmlElement(name="port")
public Set<Port> getPorts() {
    return ports;
}
项目:smart-testing    文件:Selection.java   
@XmlElementWrapper(name = "tests")
@XmlElement(name = "test")
public List<TestConfiguration> getTestConfigurations() {
    return testConfigurations;
}
项目:smart-testing    文件:ExecutionConfiguration.java   
@XmlElementWrapper(name = "strategies")
@XmlElement(name = "strategy")
public List<String> getStrategies() {
    return strategies;
}
项目:smart-testing    文件:ExecutionConfiguration.java   
@XmlElementWrapper(name = "properties")
@XmlElement(name = "property")
public List<Property> getProperties() {
    return properties;
}
项目:CharmMylynConnector    文件:CharmTask.java   
@XmlElementWrapper(name = "PARTNERS")
@XmlElement(name = "PARTNER")
public List<CharmPartner> getPartners() {
    return partners;
}
项目:CharmMylynConnector    文件:CharmTask.java   
@XmlElementWrapper(name = "COMMENTS")
@XmlElement(name = "COMMENT")
public List<CharmComment> getComments() {
    return comments;
}