in SdmxBeans/src/main/java/org/sdmxsource/sdmx/sdmxbeans/model/metadata/ReferenceValueBeanImpl.java [103:172]
private void validate() {
if (!ObjectUtil.validString(id)) {
throw new SdmxSemmanticException("Reference Value must have an Id");
}
if (ObjectUtil.validString(datasetId)) {
if (dataKeys.size() > 0) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a dataset, and a DataKey");
}
if (reportPeriod != null) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a dataset, and a Report Period");
}
if (constraintReference != null) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a dataset, and a Constraint");
}
} else if (dataKeys.size() > 0) {
if (identifiableReference != null) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a DataKey, and an Identifiable");
}
if (ObjectUtil.validString(datasetId)) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a DataKey, and a dataset");
}
if (reportPeriod != null) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a DataKey, and a Report Period");
}
if (constraintReference != null) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a DataKey, and a Constraint");
}
} else if (identifiableReference != null) {
if (dataKeys.size() > 0) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both an Identifiable, and a DataKey");
}
if (ObjectUtil.validString(datasetId)) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both an Identifiable, and a dataset");
}
if (reportPeriod != null) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both an Identifiable, and a Report Period");
}
if (constraintReference != null) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both an Identifiable, and a Constraint");
}
} else if (reportPeriod != null) {
if (identifiableReference != null) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a Report Period, and an Identifiable");
}
if (dataKeys.size() > 0) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a Report Period, and a DataKey");
}
if (ObjectUtil.validString(datasetId)) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a Report Period, and a dataset");
}
if (constraintReference != null) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a Report Period, and a Constraint");
}
} else if (constraintReference != null) {
if (identifiableReference != null) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a Constraint, and an Identifiable");
}
if (ObjectUtil.validString(datasetId)) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a Constraint, and a dataset");
}
if (dataKeys.size() > 0) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a Constraint, and a DataKey");
}
if (reportPeriod != null) {
throw new SdmxSemmanticException("Reference Value can only contain one target, a datakey, dataset, report period, or an identifiable. '" + id + "' references both a Constraint, and a Report Period");
}
} else {
throw new SdmxSemmanticException("Metadata Reference Value must referenece either a datakey, dataset, report period, or an identifiable");
}
}