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 Project: sis   Author: apache   File: CC_GeneralParameterValue.java    License: 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 Project: zstack   Author: zstackio   File: DeployerValidator.java    License: 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 Project: amazon-ecs-java-microservices   Author: aws-samples   File: Vets.java    License: 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 Project: sis   Author: apache   File: DefaultMetadata.java    License: 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 Project: windup   Author: windup   File: ReportLinkImpl.java    License: 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 #6
Source Project: Java-OCA-OCPP   Author: ChargeTimeEU   File: ClearChargingProfileRequest.java    License: 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 #7
Source Project: ecs-cf-service-broker   Author: thecodeteam   File: ObjectBucketInfo.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "api_type")
public String getApiType() {
    return apiType;
}
 
Example #8
Source Project: OpenLabeler   Author: kinhong   File: ObjectModel.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "truncated")
@XmlJavaTypeAdapter(BooleanAdapter.class)
public Boolean getTruncated() {
    return truncated;
}
 
Example #9
Source Project: OpenLabeler   Author: kinhong   File: BoundBox.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "xmax")
@XmlJavaTypeAdapter(PointAdapter.class)
public Double getXMax() {
    return xmax;
}
 
Example #10
Source Project: carbon-device-mgt   Author: wso2   File: ArchivalConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "DataSourceConfiguration", required = true)
public DataSourceConfig getDataSourceConfig() {
    return dataSourceConfig;
}
 
Example #11
Source Project: nessus-java-client   Author: continuumsecurity   File: ReportV6.java    License: GNU Affero General Public License v3.0 4 votes vote down vote up
@XmlElement(name = "hosts")
public List<HostV6> getHosts() {
	return hosts;
}
 
Example #12
Source Project: jumbune   Author: Impetus   File: JobDetails.java    License: GNU Lesser General Public License v3.0 4 votes vote down vote up
@XmlElement
public void setJob(List<JobInfo> job) {
	this.job = job;
}
 
Example #13
Source Project: openAGV   Author: tcrct   File: VisualLayoutTO.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "color")
public List<Color> getColors() {
  return colors;
}
 
Example #14
Source Project: entando-components   Author: entando   File: JAXBField.java    License: GNU Lesser General Public License v3.0 4 votes vote down vote up
@XmlElement(name = "name")
public String getName() {
    return name;
}
 
Example #15
Source Project: oxAuth   Author: GluuFederation   File: UmaResource.java    License: MIT License 4 votes vote down vote up
@JsonProperty(value = "name")
@XmlElement(name = "name")
public String getName() {
    return name;
}
 
Example #16
Source Project: kafka-message-tool   Author: grzegorz-wolszczak   File: SenderConfigPojo.java    License: MIT License 4 votes vote down vote up
@XmlElement(name = XmlElementNames.MESSAGE_KEY)
public String getMessageKey() {
    return messageKey;
}
 
Example #17
Source Project: yes-cart   Author: inspire-software   File: OrderItemRO.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "item-b2b-remarks")
public String getB2bRemarks() {
    return b2bRemarks;
}
 
Example #18
Source Project: knox   Author: apache   File: ServiceDefinition.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "dispatch")
public CustomDispatch getDispatch() {
  return dispatch;
}
 
Example #19
Source Project: carbon-device-mgt   Author: wso2   File: Profile.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement
public List<ProfileFeature> getProfileFeaturesList() {
    return profileFeaturesList;
}
 
Example #20
Source Project: REST-API-Client   Author: igniterealtime   File: ParticipantEntity.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement
public String getAffiliation() {
	return affiliation;
}
 
Example #21
Source Project: sis   Author: apache   File: DefaultConformanceResult.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Returns the citation of product specification or user requirement against which data is being evaluated.
 *
 * @return citation of product specification or user requirement, or {@code null}.
 */
@Override
@XmlElement(name = "specification", required = true)
public Citation getSpecification() {
    return specification;
}
 
Example #22
Source Project: reladomo-scala   Author: folio-sec   File: MithraObject.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "AsOfAttribute")
public List<AsOfAttribute> getAsOfAttributes() {
    return asOfAttributes;
}
 
Example #23
Source Project: carbon-device-mgt   Author: wso2   File: DeviceStatusTaskConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "Frequency", required = true)
public int getFrequency() {
    return frequency;
}
 
Example #24
Source Project: sissi   Author: KimShen   File: Bytestreams.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElements({ @XmlElement(name = Streamhost.NAME, type = Streamhost.class) })
public List<Streamhost> getStreamhost() {
	return this.streamhosts;
}
 
Example #25
Source Project: proarc   Author: proarc   File: AnnotatedSearchViewItem.java    License: GNU General Public License v3.0 4 votes vote down vote up
@XmlElement(name = DigitalObjectResourceApi.MEMBERS_ITEM_STATE)
@Override
public abstract String getState();
 
Example #26
Source Project: osiris   Author: osiris-indoor   File: OSM.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "relation")
public List<Relation> getRelations() {
	return relations;
}
 
Example #27
Source Project: zap-extensions   Author: zaproxy   File: AlertItem.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "Attack")
public void setAttack(String attack) {
    this.attack = attack;
}
 
Example #28
Source Project: entando-core   Author: entando   File: I18nLabelResponseResult.java    License: GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
@XmlElement(name = "item", required = false)
public JAXBI18nLabel getResult() {
    return (JAXBI18nLabel) this.getMainResult();
}
 
Example #29
Source Project: cxf   Author: apache   File: JaxbBean1.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement(type = CustomStringType.class)
public String getElementProperty() {
    return elementProperty;
}
 
Example #30
Source Project: ambari-metrics   Author: apache   File: TimelineMetrics.java    License: Apache License 2.0 4 votes vote down vote up
@XmlElement(name = "metrics")
public List<TimelineMetric> getMetrics() {
  return allMetrics;
}