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;
}
java类javax.xml.bind.annotation.XmlElementWrapper的实例源码
TypeInfo.java 文件源码
项目:openjdk-jdk10
阅读 30
收藏 0
点赞 0
评论 0
MCRUser.java 文件源码
项目:mycore
阅读 33
收藏 0
点赞 0
评论 0
@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()]);
}
MCRUser.java 文件源码
项目:mycore
阅读 27
收藏 0
点赞 0
评论 0
@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()]);
}
Project.java 文件源码
项目:AgentWorkbench
阅读 24
收藏 0
点赞 0
评论 0
/**
* 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;
}
ERPropertyInfoImpl.java 文件源码
项目:OpenJSharp
阅读 32
收藏 0
点赞 0
评论 0
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;
}
PropertyInfoImpl.java 文件源码
项目:OpenJSharp
阅读 25
收藏 0
点赞 0
评论 0
/**
* 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");
}
Key.java 文件源码
项目:stroom-query
阅读 33
收藏 0
点赞 0
评论 0
@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;
}
DirectoryScannerConfig.java 文件源码
项目:jdk8u-jdk
阅读 27
收藏 0
点赞 0
评论 0
/**
* 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]);
}
}
DirectoryScannerConfig.java 文件源码
项目:jdk8u-jdk
阅读 30
收藏 0
点赞 0
评论 0
/**
* 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]);
}
}
ERPropertyInfoImpl.java 文件源码
项目:openjdk-jdk10
阅读 33
收藏 0
点赞 0
评论 0
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;
}
PropertyInfoImpl.java 文件源码
项目:openjdk-jdk10
阅读 34
收藏 0
点赞 0
评论 0
/**
* 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");
}
DirectoryScannerConfig.java 文件源码
项目:openjdk9
阅读 34
收藏 0
点赞 0
评论 0
/**
* 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]);
}
}
ERPropertyInfoImpl.java 文件源码
项目:openjdk9
阅读 43
收藏 0
点赞 0
评论 0
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;
}
Serializer.java 文件源码
项目:ibas-framework
阅读 24
收藏 0
点赞 0
评论 0
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;
}
CAgentContainer.java 文件源码
项目:REST
阅读 28
收藏 0
点赞 0
评论 0
/**
* returns the running plans
*
* @return list with running plans
*/
@Nonnull
@XmlElementWrapper( name = "runningplans" )
@XmlElement( name = "runningplan" )
public final List<ITerm> getRunningplan()
{
return m_runningplan;
}
OperationResult.java 文件源码
项目:ibas-framework
阅读 26
收藏 0
点赞 0
评论 0
@Override
@XmlElementWrapper(name = "ResultObjects")
@XmlElement(name = "ResultObject")
public final ArrayList<P> getResultObjects() {
if (this.resultObjects == null) {
this.resultObjects = new ArrayList<P>();
}
return this.resultObjects;
}
OperationResult.java 文件源码
项目:ibas-framework
阅读 31
收藏 0
点赞 0
评论 0
@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;
}
Criteria.java 文件源码
项目:ibas-framework
阅读 27
收藏 0
点赞 0
评论 0
@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;
}
Criteria.java 文件源码
项目:ibas-framework
阅读 28
收藏 0
点赞 0
评论 0
@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;
}
DirectoryScannerConfig.java 文件源码
项目:lookaside_java-1.8.0-openjdk
阅读 31
收藏 0
点赞 0
评论 0
/**
* 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]);
}
}
CasMappings.java 文件源码
项目:biomedicus
阅读 32
收藏 0
点赞 0
评论 0
/**
* 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;
}
MCRViewerConfiguration.java 文件源码
项目:mycore
阅读 30
收藏 0
点赞 0
评论 0
@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());
}
JaxbSearchTemplate.java 文件源码
项目:documentum-rest-client-java
阅读 41
收藏 0
点赞 0
评论 0
@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;
}
MutableOverride.java 文件源码
项目:cloudkeeper
阅读 33
收藏 0
点赞 0
评论 0
@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;
}
MutableParentModule.java 文件源码
项目:cloudkeeper
阅读 29
收藏 0
点赞 0
评论 0
@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;
}
PropertyInfoImpl.java 文件源码
项目:lookaside_java-1.8.0-openjdk
阅读 28
收藏 0
点赞 0
评论 0
/**
* 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");
}
SendPicsInfo.java 文件源码
项目:framework
阅读 27
收藏 0
点赞 0
评论 0
@XmlElementWrapper(name = "PicList")
@XmlElement(name = "item")
public List<Item> getItem() {
return item;
}
WechatResponse.java 文件源码
项目:framework
阅读 31
收藏 0
点赞 0
评论 0
@XmlElementWrapper(name = "Articles")
@XmlElement(name = "item")
public List<ArticleResponse> getArticle() {
return article;
}
Pet.java 文件源码
项目:microprofile-open-api
阅读 35
收藏 0
点赞 0
评论 0
@XmlElementWrapper(name = "photoUrls")
@XmlElement(name = "photoUrl", required = true)
public List<String> getPhotoUrls() {
return photoUrls;
}
Pet.java 文件源码
项目:microprofile-open-api
阅读 27
收藏 0
点赞 0
评论 0
@XmlElementWrapper(name = "tags")
@XmlElement(name = "tag")
public List<Tag> getTags() {
return tags;
}