/** * The documentation type for resources.<br> * Created on: Jun 11, 2008<br> * * @author Martin Grotzke (martin.grotzke at freiheit.com) */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "resourceDoc", propOrder = { "classDoc" }) @XmlRootElement(name = "resourceDoc") public class ResourceDocType { @XmlElementWrapper(name = "classDocs") protected List<ClassDocType> classDoc; public List<ClassDocType> getDocs() { if (classDoc == null) { classDoc = new ArrayList<ClassDocType>(); } return this.classDoc; } }
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "responseDoc", propOrder = { @XmlElementWrapper(name = "wadlParams") protected List<WadlParamType> wadlParam; @XmlElementWrapper(name = "representations") protected List<RepresentationDocType> representation;
@XmlRootElement public class AlertPatchResponse { @XmlElementWrapper @XmlElements({ @XmlElement(name = "AlertPatch", type = AlertPatch.class) }) public List<AlertPatch> alertPatches; public void addAlertPatch(AlertPatch alertPatch) { if (alertPatches == null) { alertPatches = new ArrayList<AlertPatch>(); } alertPatches.add(alertPatch); } }
@XmlElementWrapper @XmlElement(name = "trip") public List<TripsModelInfo> getTrips() { return trips; }
@XmlAccessorType(XmlAccessType.NONE) public class DefaultTier extends ValidatingConfig<StandaloneCatalog> implements Tier, Externalizable { @XmlElementWrapper(name = "limits", required = false) @XmlElement(name = "limit", required = false) private DefaultLimit[] limits; @XmlElementWrapper(name = "blocks", required = false) @XmlElement(name = "tieredBlock", required = false) private DefaultTieredBlock[] blocks; @XmlElement(required = false) private DefaultInternationalPrice fixedPrice;
@XmlAttribute @JsonSerialize public String mode = TraverseMode.WALK.toString(); @XmlAttribute @JsonSerialize public String route = ""; @XmlAttribute @JsonSerialize public String agencyName; @XmlElementWrapper(name = "intermediateStops") @JsonProperty(value="intermediateStops") public List<Place> stop; @XmlElementWrapper(name = "steps") @JsonProperty(value="steps") public List<WalkStep> walkSteps; @XmlElement @JsonSerialize public List<LocalizedAlert> alerts;
@XmlType( name = "Tile" ) public class DockerArrangementTile extends DockerArrangementNode { @XmlElementWrapper( name = "views" ) @XmlElement( name = "view" ) public List<String> viewIds = new ArrayList<>( ); @XmlElement( name = "selectedView" ) public String selectedViewId = null; public boolean isMaximized = false; }
XmlElement el = (XmlElement)ann; av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;", true); if ("##default".equals(el.name())) { av0.visit("name", name); } else { av0.visit("name", el.name()); av0.visit("nillable", el.nillable()); av0.visit("required", el.required()); av0.visit("namespace", el.namespace()); XmlElementWrapper el = (XmlElementWrapper)ann; av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElementWrapper;", true); av0.visit("name", el.name()); av0.visit("nillable", el.nillable()); av0.visit("required", el.required()); av0.visit("namespace", el.namespace()); av0.visitEnd();
protected static String getTypeName(Annotation[] annotations, String dflt) { String name = null; for (Annotation a : annotations) { if (a.annotationType() == XmlAttribute.class) { name = ((XmlAttribute)a).name(); } else if (a.annotationType() == XmlElement.class) { name = ((XmlElement)a).name(); } else if (a.annotationType() == XmlElementRef.class) { name = ((XmlElementRef)a).name(); } else if (a.annotationType() == XmlElementWrapper.class) { name = ((XmlElementWrapper)a).name(); // break the loop as we don't want name to be overwritten by XmlElement break; } else if (a.annotationType() == XmlType.class) { name = ((XmlType)a).name(); } else if (a.annotationType() == XmlTransient.class) { // transient type return null; } } if (DEFAULT_NAME.equals(name)) { return dflt; } return name; }
/** * Puts definitions for XML wrapper. * * @param wrapper XmlElementWrapper * @param property property instance to be updated */ private static void applyElement(XmlElementWrapper wrapper, Schema property) { if (wrapper != null) { final XML xml = getXml(property); xml.setWrapped(true); // No need to set the xml name if the name provided by xmlelementwrapper annotation is ##default or equal to the property name | https://github.com/swagger-api/swagger-core/pull/2050 if (!"##default".equals(wrapper.name()) && !wrapper.name().isEmpty() && !wrapper.name().equals(property.getName())) { xml.setName(wrapper.name()); } } }
/** * The namespace of the wrapper element. * * @return The namespace of the wrapper element. */ public String getWrapperNamespace() { String namespace = null; if (getForm() == XmlNsForm.QUALIFIED) { namespace = getTypeDefinition().getNamespace(); } XmlElementWrapper xmlElementWrapper = getAnnotation(XmlElementWrapper.class); if ((xmlElementWrapper != null) && (!"##default".equals(xmlElementWrapper.namespace()))) { namespace = xmlElementWrapper.namespace(); } return namespace; }
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "responseDoc", propOrder = { @XmlElementWrapper(name = "wadlParams") protected List<WadlParamType> wadlParam; @XmlElementWrapper(name = "representations") protected List<RepresentationDocType> representation;
@XmlRootElement(name = "monster") class Monster { public String name = ""; @XmlElementWrapper() @XmlElement(name = "children") public java.util.List<String> children = new ArrayList<String>(); } }
/** * @return the list of dead nodes */ @XmlElement(name = "Node") @XmlElementWrapper(name = "DeadNodes") // workaround https://github.com/FasterXML/jackson-dataformat-xml/issues/192 @JsonProperty("DeadNodes") public List<String> getDeadNodes() { return deadNodes; }
@XmlAccessorType(XmlAccessType.NONE) @XmlElement(required = false, name = "numberOfUnpaidInvoicesEqualsOrExceeds") private Integer numberOfUnpaidInvoicesEqualsOrExceeds; @XmlElement(required = false, name = "totalUnpaidInvoiceBalanceEqualsOrExceeds") private BigDecimal totalUnpaidInvoiceBalanceEqualsOrExceeds; @XmlElement(required = false, name = "timeSinceEarliestUnpaidInvoiceEqualsOrExceeds") private DefaultDuration timeSinceEarliestUnpaidInvoiceEqualsOrExceeds; @XmlElementWrapper(required = false, name = "responseForLastFailedPaymentIn") @XmlElement(required = false, name = "response") private PaymentResponse[] responseForLastFailedPayment;
public class TestCatalogSafetyInitializer { @XmlElementWrapper(name = "initialPhasesWrapperAllRequired", required = true) @XmlElement(name = "phase", required = true) private DefaultPlanPhase[] initialPhasesWrapperAllRequired; @XmlElementWrapper(name = "initialPhasesWrapperNotRequired", required = false) @XmlElement(name = "phase", required = false) private DefaultPlanPhase[] initialPhasesWrapperNotRequired; @XmlElementWrapper(name = "initialPhasesWrapper", required = true) @XmlElement(name = "phase", required = false) private DefaultPlanPhase[] initialPhasesWrapper; private DefaultPrice[] prices; @XmlElementWrapper(name = "available", required = false) @XmlIDREF @XmlElement(type = DefaultProduct.class, name = "addonProduct", required = false) private int smallNumber; @XmlAttribute(required = false) private FixedType type;
/** * The name of the wrapper element. * * @return The name of the wrapper element. */ public String getWrapperName() { String name = getSimpleName().toString(); XmlElementWrapper xmlElementWrapper = getAnnotation(XmlElementWrapper.class); if ((xmlElementWrapper != null) && (!"##default".equals(xmlElementWrapper.name()))) { name = xmlElementWrapper.name(); } return name; }
/** * The namespace of the wrapper element. * * @return The namespace of the wrapper element. */ public String getWrapperNamespace() { String namespace = null; if (getForm() == XmlNsForm.QUALIFIED) { namespace = getTypeDefinition().getNamespace(); } XmlElementWrapper xmlElementWrapper = getAnnotation(XmlElementWrapper.class); if ((xmlElementWrapper != null) && (!"##default".equals(xmlElementWrapper.namespace()))) { namespace = xmlElementWrapper.namespace(); } return namespace; }
/** * The documentation type for resources.<br> * Created on: Jun 11, 2008<br> * * @author Martin Grotzke (martin.grotzke at freiheit.com) */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "resourceDoc", propOrder = { "classDoc" }) @XmlRootElement(name = "resourceDoc") public class ResourceDocType { @XmlElementWrapper(name = "classDocs") protected List<ClassDocType> classDoc; public List<ClassDocType> getDocs() { if (classDoc == null) { classDoc = new ArrayList<ClassDocType>(); } return this.classDoc; } }