Skip to content

Commit

Permalink
Merge branch 'main' into fix_#432_several_aas_issues_hindering_import…
Browse files Browse the repository at this point in the history
…_to_aas_package_explorer
  • Loading branch information
bs-jokri authored Oct 20, 2023
2 parents dac5297 + a3c61d9 commit 0da3d32
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,9 @@ private Optional<DateFormat> getDateFormat( final String urn ) {
if ( XSD.duration.getURI().equals( urn ) ) {
return Optional.of( new SimpleDateFormat( "PddD" ) );
}
if ( XSD.date.getURI().equals( urn ) ) {
return Optional.of( new SimpleDateFormat( "yyyy-MM-dd" ) );
}
return Optional.empty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,25 @@ public class AspectWithConstraints {
@JsonCreator
public AspectWithConstraints(
@JsonProperty( value = "testPropertyWithRegularExpression" )
String testPropertyWithRegularExpression,
String testPropertyWithRegularExpression,
@JsonProperty( value = "testPropertyWithDecimalMinDecimalMaxRangeConstraint" )
BigDecimal testPropertyWithDecimalMinDecimalMaxRangeConstraint,
BigDecimal testPropertyWithDecimalMinDecimalMaxRangeConstraint,
@JsonProperty( value = "testPropertyWithDecimalMaxRangeConstraint" )
BigDecimal testPropertyWithDecimalMaxRangeConstraint,
BigDecimal testPropertyWithDecimalMaxRangeConstraint,
@JsonProperty( value = "testPropertyWithMinMaxRangeConstraint" )
Integer testPropertyWithMinMaxRangeConstraint,
Integer testPropertyWithMinMaxRangeConstraint,
@JsonProperty( value = "testPropertyWithMinRangeConstraint" )
Integer testPropertyWithMinRangeConstraint,
Integer testPropertyWithMinRangeConstraint,
@JsonProperty( value = "testPropertyRangeConstraintWithFloatType" )
Float testPropertyRangeConstraintWithFloatType,
Float testPropertyRangeConstraintWithFloatType,
@JsonProperty( value = "testPropertyRangeConstraintWithDoubleType" )
Double testPropertyRangeConstraintWithDoubleType,
Double testPropertyRangeConstraintWithDoubleType,
@JsonProperty( value = "testPropertyWithMinMaxLengthConstraint" )
String testPropertyWithMinMaxLengthConstraint,
String testPropertyWithMinMaxLengthConstraint,
@JsonProperty( value = "testPropertyWithMinLengthConstraint" )
BigInteger testPropertyWithMinLengthConstraint,
BigInteger testPropertyWithMinLengthConstraint,
@JsonProperty( value = "testPropertyCollectionLengthConstraint" )
List<BigInteger> testPropertyCollectionLengthConstraint ) {
List<BigInteger> testPropertyCollectionLengthConstraint ) {
this.testPropertyWithRegularExpression = testPropertyWithRegularExpression;
this.testPropertyWithDecimalMinDecimalMaxRangeConstraint =
testPropertyWithDecimalMinDecimalMaxRangeConstraint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class AspectWithGenericNumericProperty {

@JsonCreator
public AspectWithGenericNumericProperty(
@JsonProperty(value = "testNumber") Number testNumber) {
@JsonProperty( value = "testNumber" ) Number testNumber ) {
this.testNumber = testNumber;
}

Expand All @@ -43,15 +43,15 @@ public Number getTestNumber() {
}

@Override
public boolean equals(final Object o) {
if (this == o) {
public boolean equals( final Object o ) {
if ( this == o ) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if ( o == null || getClass() != o.getClass() ) {
return false;
}
final AspectWithGenericNumericProperty that = (AspectWithGenericNumericProperty) o;
return Objects.equals(testNumber, that.testNumber);
return Objects.equals( testNumber, that.testNumber );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
/** Generated class for Test Aspect. */
public class AspectWithRangeConstraintWithoutMinMaxIntegerValue {

@NotNull private BigInteger testInt;
@NotNull
private BigInteger testInt;

@JsonCreator
public AspectWithRangeConstraintWithoutMinMaxIntegerValue(
@JsonProperty(value = "testInt") BigInteger testInt) {
@JsonProperty( value = "testInt" ) BigInteger testInt ) {
this.testInt = testInt;
}

Expand All @@ -41,16 +42,16 @@ public BigInteger getTestInt() {
}

@Override
public boolean equals(final Object o) {
if (this == o) {
public boolean equals( final Object o ) {
if ( this == o ) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if ( o == null || getClass() != o.getClass() ) {
return false;
}
final AspectWithRangeConstraintWithoutMinMaxIntegerValue that =
(AspectWithRangeConstraintWithoutMinMaxIntegerValue) o;
return Objects.equals(testInt, that.testInt);
return Objects.equals( testInt, that.testInt );
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ public void testEnumComplexMapping( final KnownVersion metaModelVersion ) {
assertThat( context.<String> read( "$['components']['schemas']['ResultGood']['properties']['details']"
+ "['properties']['message']['enum'][0]" ) ).isEqualTo( "Evaluation succeeded." );
assertThat( context.<Integer> read( "$['components']['schemas']['ResultGood']['properties']['details']"
+ "['properties']['numericCode']['enum'][0]" ) ).isEqualTo( 10 );
+ "['properties']['numericCode']['enum'][0]" ) ).isEqualTo( 10 );
}

@ParameterizedTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

package org.eclipse.esmf.aspectmodel.java.customconstraint;

import org.eclipse.esmf.metamodel.impl.BoundDefinition;

import jakarta.validation.ConstraintValidator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

package org.eclipse.esmf.aspectmodel.java.customconstraint;

import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

package org.eclipse.esmf.aspectmodel.java.customconstraint;

import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
import javax.xml.datatype.DatatypeConstants;
import javax.xml.datatype.DatatypeFactory;

import org.apache.commons.lang3.StringUtils;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.vocabulary.XSD;
import org.apache.velocity.app.FieldMethodizer;
import org.eclipse.esmf.aspectmodel.generator.ArtifactGenerator;
import org.eclipse.esmf.aspectmodel.generator.TemplateEngine;
import org.eclipse.esmf.aspectmodel.java.AspectModelJavaUtil;
Expand All @@ -40,25 +36,26 @@
import org.eclipse.esmf.aspectmodel.java.ValueInitializer;
import org.eclipse.esmf.aspectmodel.java.exception.CodeGenerationException;
import org.eclipse.esmf.aspectmodel.resolver.services.DataType;

import org.eclipse.esmf.characteristic.Trait;
import org.eclipse.esmf.metamodel.ComplexType;
import org.eclipse.esmf.metamodel.Constraint;
import org.eclipse.esmf.metamodel.Scalar;
import org.eclipse.esmf.metamodel.StructureElement;
import org.eclipse.esmf.metamodel.impl.DefaultScalar;
import org.eclipse.esmf.metamodel.impl.DefaultScalarValue;

import org.eclipse.esmf.samm.KnownVersion;
import org.jboss.forge.roaster.Roaster;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.google.common.collect.ImmutableMap;

import jakarta.validation.constraints.NotNull;
import org.apache.commons.lang3.StringUtils;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.vocabulary.XSD;
import org.apache.velocity.app.FieldMethodizer;
import org.jboss.forge.roaster.Roaster;

/**
* A {@link ArtifactGenerator} that generates Java Pojo code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ ImmutableMap.<Class<?>, Class<?>> builder()
public Class<?> getAnnotationType( final Class<?> type ) {
return typeMapping.get( type );
}
}
}

0 comments on commit 0da3d32

Please sign in to comment.