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; }
@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()]); }
@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()]); }
/** * 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; }
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; }
/** * 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"); }
@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; }
/** * 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]); } }
/** * 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]); } }
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; }
/** * returns the running plans * * @return list with running plans */ @Nonnull @XmlElementWrapper( name = "runningplans" ) @XmlElement( name = "runningplan" ) public final List<ITerm> getRunningplan() { return m_runningplan; }
@Override @XmlElementWrapper(name = "ResultObjects") @XmlElement(name = "ResultObject") public final ArrayList<P> getResultObjects() { if (this.resultObjects == null) { this.resultObjects = new ArrayList<P>(); } return this.resultObjects; }
@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; }
@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; }
@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; }
/** * 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; }
@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()); }
@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; }
@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; }
@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; }
@XmlElementWrapper(name = "PicList") @XmlElement(name = "item") public List<Item> getItem() { return item; }
@XmlElementWrapper(name = "Articles") @XmlElement(name = "item") public List<ArticleResponse> getArticle() { return article; }
@XmlElementWrapper(name = "photoUrls") @XmlElement(name = "photoUrl", required = true) public List<String> getPhotoUrls() { return photoUrls; }
@XmlElementWrapper(name = "tags") @XmlElement(name = "tag") public List<Tag> getTags() { return tags; }
@XmlElementWrapper(name = "rolesAllowed") @XmlElement(name="role") public Set<String> getRolesAllowed() { return rolesAllowed; }
@XmlElementWrapper(name="categories", required=false) @XmlElement(name="category", required=false) public List<String> getCategories() { return categories; }
@XmlElementWrapper(name="hostnames", required=false) @XmlElement(name="hostname", required=false) public Set<Hostname> getHostNames() { return hostNames; }
@XmlElementWrapper(name="trace") @XmlElement(name="hop") public LinkedList<Hop> getTrace() { return trace; }
@XmlElementWrapper(name="ports") @XmlElement(name="port") public Set<Port> getPorts() { return ports; }
@XmlElementWrapper(name = "tests") @XmlElement(name = "test") public List<TestConfiguration> getTestConfigurations() { return testConfigurations; }
@XmlElementWrapper(name = "strategies") @XmlElement(name = "strategy") public List<String> getStrategies() { return strategies; }
@XmlElementWrapper(name = "properties") @XmlElement(name = "property") public List<Property> getProperties() { return properties; }
@XmlElementWrapper(name = "PARTNERS") @XmlElement(name = "PARTNER") public List<CharmPartner> getPartners() { return partners; }
@XmlElementWrapper(name = "COMMENTS") @XmlElement(name = "COMMENT") public List<CharmComment> getComments() { return comments; }