当前位置: 首页>>代码示例>>Java>>正文


Java XmlElementWrapper类代码示例

本文整理汇总了Java中javax.xml.bind.annotation.XmlElementWrapper的典型用法代码示例。如果您正苦于以下问题:Java XmlElementWrapper类的具体用法?Java XmlElementWrapper怎么用?Java XmlElementWrapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


XmlElementWrapper类属于javax.xml.bind.annotation包,在下文中一共展示了XmlElementWrapper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getItemType

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
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;
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:TypeInfo.java

示例2: getRoles

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
@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()]);
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:21,代码来源:MCRUser.java

示例3: getAttributesMap

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
@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()]);
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:17,代码来源:MCRUser.java

示例4: getSimulationSetups

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:12,代码来源:Project.java

示例5: ERPropertyInfoImpl

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:ERPropertyInfoImpl.java

示例6: calcXmlName

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
/**
 * 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");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:PropertyInfoImpl.java

示例7: getValues

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
@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;
}
 
开发者ID:gchq,项目名称:stroom-query,代码行数:14,代码来源:Key.java

示例8: getIncludeFiles

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
/**
 * 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]);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:DirectoryScannerConfig.java

示例9: getExcludeFiles

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
/**
 * 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]);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:DirectoryScannerConfig.java

示例10: getSerializedElements

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
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;
}
 
开发者ID:color-coding,项目名称:ibas-framework,代码行数:33,代码来源:Serializer.java

示例11: getRunningplan

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
/**
 * returns the running plans
 *
 * @return list with running plans
 */
@Nonnull
@XmlElementWrapper( name = "runningplans" )
@XmlElement( name = "runningplan" )
public final List<ITerm> getRunningplan()
{
    return m_runningplan;
}
 
开发者ID:LightJason,项目名称:REST,代码行数:13,代码来源:CAgentContainer.java

示例12: getResultObjects

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
@Override
@XmlElementWrapper(name = "ResultObjects")
@XmlElement(name = "ResultObject")
public final ArrayList<P> getResultObjects() {
	if (this.resultObjects == null) {
		this.resultObjects = new ArrayList<P>();
	}
	return this.resultObjects;
}
 
开发者ID:color-coding,项目名称:ibas-framework,代码行数:10,代码来源:OperationResult.java

示例13: getInformations

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
@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;
}
 
开发者ID:color-coding,项目名称:ibas-framework,代码行数:10,代码来源:OperationResult.java

示例14: getConditions

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
@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;
}
 
开发者ID:color-coding,项目名称:ibas-framework,代码行数:10,代码来源:Criteria.java

示例15: getChildCriterias

import javax.xml.bind.annotation.XmlElementWrapper; //导入依赖的package包/类
@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;
}
 
开发者ID:color-coding,项目名称:ibas-framework,代码行数:10,代码来源:Criteria.java


注:本文中的javax.xml.bind.annotation.XmlElementWrapper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。