javax.xml.bind.annotation.XmlElement Java Examples

The following examples show how to use javax.xml.bind.annotation.XmlElement. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CC_GeneralParameterValue.java    From sis with Apache License 2.0 6 votes vote down vote up
/**
 * Invoked by JAXB at marshalling time for getting the actual element to write
 * inside the {@code <gml:parameterValue>} XML element.
 * This is the value or a copy of the value given in argument to the {@code wrap} method.
 *
 * @return the element to be marshalled.
 *
 * @see CC_GeneralOperationParameter#getElement()
 */
@XmlElements({  // We can not use @XmlElementRef because we have no public AbstractParameterValue parent class.
    @XmlElement(name = "ParameterValue",      type = DefaultParameterValue.class),
    @XmlElement(name = "ParameterValueGroup", type = DefaultParameterValueGroup.class)
})
public GeneralParameterValue getElement() {
    final GeneralParameterValue metadata = this.metadata;
    if (metadata instanceof DefaultParameterValue<?>) {
        return (DefaultParameterValue<?>) metadata;
    }
    if (metadata instanceof DefaultParameterValueGroup) {
        return (DefaultParameterValueGroup) metadata;
    }
    if (metadata instanceof ParameterValue) {
        return new DefaultParameterValue<>((ParameterValue<?>) metadata);
    }
    if (metadata instanceof ParameterValueGroup) {
        return new DefaultParameterValueGroup((ParameterValueGroup) metadata);
    }
    return null;    // Unknown types are currently not marshalled (we may revisit that in a future SIS version).
}
 
Example #2
Source File: DeployerValidator.java    From zstack with Apache License 2.0 6 votes vote down vote up
private void validateField(Field f, Object obj) throws IllegalArgumentException, IllegalAccessException {
    XmlType xtype = obj.getClass().getAnnotation(XmlType.class);
    if (xtype == null) {
        return;
    }

    Object val = f.get(obj);
    String elementName = xtype.name();
    logger.debug(String.format("validating %s->%s", elementName, f.getName()));

    XmlElement eat = f.getAnnotation(XmlElement.class);
    if (eat != null && eat.required() && val == null) {
        throw new IllegalArgumentException(String.format("field[%s] of element[%s] is mandatory, cannot be missed", f.getName(), elementName));
    }

    XmlAttribute aat = f.getAnnotation(XmlAttribute.class);
    if (aat != null && aat.required() && val == null) {
        throw new IllegalArgumentException(String.format("field[%s] of element[%s] is mandatory, cannot be missed", aat.name(), elementName));
    }

    if (val != null) {
        validateObject(val);
    }
}
 
Example #3
Source File: Vets.java    From amazon-ecs-java-microservices with Apache License 2.0 5 votes vote down vote up
@XmlElement
public List<Vet> getVetList() {
    if (vets == null) {
        vets = new ArrayList<>();
    }
    return vets;
}
 
Example #4
Source File: DefaultMetadata.java    From sis with Apache License 2.0 5 votes vote down vote up
/**
 * Provides information about an alternatively used localized character string for a linguistic extension.
 *
 * @return alternatively used localized character string for a linguistic extension.
 *
 * @deprecated Replaced by <code>{@linkplain #getLocalesAndCharsets()}.keySet()</code>.
 */
@Override
@Deprecated
@Dependencies("getLocalesAndCharsets")
@XmlElement(name = "locale", namespace = LegacyNamespaces.GMD)
@XmlJavaTypeAdapter(LocaleAdapter.Wrapped.class)
public Collection<Locale> getLocales() {
    if (FilterByVersion.LEGACY_METADATA.accept()) {
        final Set<PT_Locale> locales = OtherLocales.filter(getLocalesAndCharsets());
        return Containers.derivedSet(locales, ToLocale.INSTANCE);
    }
    return null;
}
 
Example #5
Source File: ClearChargingProfileRequest.java    From Java-OCA-OCPP with MIT License 5 votes vote down vote up
/**
 * Optional. Specifies the ID of the connector for which to clear charging profiles.
 *
 * @param connectorId integer. value &ge; 0
 */
@XmlElement
public void setConnectorId(Integer connectorId) {
  if (connectorId != null && connectorId < 0) {
    throw new PropertyConstraintException(connectorId, "connectorId must be >= 0");
  }

  this.connectorId = connectorId;
}
 
Example #6
Source File: ReportLinkImpl.java    From windup with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Contains the File path of the report.
 */
@Override
@XmlElement(name = "report-file")
public File getReportFile()
{
    return reportFile;
}
 
Example #7
Source File: Customer.java    From resteasy-examples with Apache License 2.0 4 votes vote down vote up
@XmlElement
public String getZip()
{
   return zip;
}
 
Example #8
Source File: TransferResource.java    From oodt with Apache License 2.0 4 votes vote down vote up
/**
 * Gets the percentage complete status of the file transfer.
 * @return the percentage complete status of the file transfer
 */
@XmlElement
public double getPercentComplete()
{
  return status.computePctTransferred() * 100;
}
 
Example #9
Source File: RoleBasedFilterConfig.java    From development with Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "configEntry")
public Set<RoleBasedFilterConfigEntry> getEntries() {
    return entries;
}
 
Example #10
Source File: LinkedListItem.java    From entando-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
@XmlElement(name = "url", required = false)
public String getUrl() {
	return _url;
}
 
Example #11
Source File: TSVResult.java    From hybris-commerce-eclipse-plugin with Apache License 2.0 4 votes vote down vote up
@XmlElement
public void setState(String state) {
	this.state = state;
}
 
Example #12
Source File: JAXBTaskList.java    From entando-components with GNU Lesser General Public License v3.0 4 votes vote down vote up
@XmlElement(name = "processId")
public String getProcessId() {
    return processId;
}
 
Example #13
Source File: JAXBFileAttribute.java    From entando-components with GNU Lesser General Public License v3.0 4 votes vote down vote up
@XmlElement(name = "value", required = false)
public AttachedFile getAttachedFile() {
	return _attachedFile;
}
 
Example #14
Source File: Server.java    From ldap-in-memory with Apache License 2.0 4 votes vote down vote up
@XmlElement(name="bindDn", required = true)
public void setBindDn(String bindDn) {
    this.bindDn = bindDn;
}
 
Example #15
Source File: DefaultProcessStep.java    From sis with Apache License 2.0 4 votes vote down vote up
/**
 * Returns the information about the source data used in creating the data specified by the scope.
 *
 * @return information about the source data used in creating the data.
 */
@Override
@XmlElement(name = "source")
public Collection<Source> getSources() {
    return sources = nonNullCollection(sources, Source.class);
}
 
Example #16
Source File: ComponentErrorStatus.java    From CloverETL-Engine with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
@XmlElement(name = "StatusCode")
public Integer getStatusCode() {
	return statusCode;
}
 
Example #17
Source File: JaxbBatchOperation.java    From documentum-rest-client-java with Apache License 2.0 4 votes vote down vote up
@Override
@XmlElement
public Batch.Status getState() {
    return state;
}
 
Example #18
Source File: TestXmlID3.java    From jackson-modules-base with Apache License 2.0 4 votes vote down vote up
@XmlElement
public HasID getParent() { return parent; }
 
Example #19
Source File: InputMessage.java    From weixin4j with Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "ScanCodeInfo")
public void setScanCodeInfo(ScanCodeInfo ScanCodeInfo) {
    this.ScanCodeInfo = ScanCodeInfo;
}
 
Example #20
Source File: Order.java    From swagger-petstore with Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "shipDate")
public Date getShipDate() {
  return shipDate;
}
 
Example #21
Source File: FacesConverter.java    From tomee with Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "display-name", required = true)
public Text[] getDisplayNames() {
    return displayName.toArray();
}
 
Example #22
Source File: AnnotatedUser.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
@XmlElement(name = UserResourceApi.USER_FORENAME)
@Override
public abstract String getForename();
 
Example #23
Source File: TopNConfig.java    From ambari-metrics with Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "topn")
public Integer getTopN() {
  return topN;
}
 
Example #24
Source File: ResponsePayload.java    From carbon-device-mgt with Apache License 2.0 4 votes vote down vote up
@XmlElement
public Object getResponseContent() {
    return responseContent;
}
 
Example #25
Source File: CartValidationRO.java    From yes-cart with Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "cart-validation-item")
public List<CartValidationItemRO> getItems() {
    return items;
}
 
Example #26
Source File: Tag.java    From swagger-maven-plugin with Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "name")
public String getName() {
    return name;
}
 
Example #27
Source File: JAXBProcessInstance.java    From entando-components with GNU Lesser General Public License v3.0 4 votes vote down vote up
@XmlElement(name = "process-name")
public String getProcessName() {
    return processName;
}
 
Example #28
Source File: JApiClass.java    From japicmp with Apache License 2.0 4 votes vote down vote up
@XmlElementWrapper(name = "constructors")
@XmlElement(name = "constructor")
public List<JApiConstructor> getConstructors() {
	return constructors;
}
 
Example #29
Source File: IssueFields.java    From rtc2jira with GNU General Public License v2.0 4 votes vote down vote up
@JsonView(IssueView.Update.class)
@XmlElement(name = "customfield_10207", nillable = true)
public Integer getDpReqNr() { // done
  return dpReqNr;
}
 
Example #30
Source File: Policy.java    From carbon-device-mgt with Apache License 2.0 4 votes vote down vote up
@XmlElement
public List<PolicyCriterion> getPolicyCriterias() {
    return policyCriterias;
}