forked from atlasmap/atlasmap
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add CSV Module, include basic standalone UI
Fixes: atlasmap#2018
- Loading branch information
1 parent
f13fead
commit 6523511
Showing
19 changed files
with
410 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,4 +76,3 @@ Thumbs.db | |
**/bin | ||
/ui/node | ||
/ui/yarn-error.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
153 changes: 153 additions & 0 deletions
153
lib/modules/csv/model/src/main/java/io/atlasmap/csv/v2/CsvComplexType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
/** | ||
* Copyright (C) 2017 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.atlasmap.csv.v2; | ||
|
||
import com.fasterxml.jackson.annotation.JsonTypeInfo; | ||
|
||
import java.io.Serializable; | ||
|
||
@JsonTypeInfo(include = JsonTypeInfo.As.PROPERTY, use = JsonTypeInfo.Id.CLASS, property = "jsonType") | ||
public class CsvComplexType extends CsvField implements Serializable { | ||
|
||
private final static long serialVersionUID = 1L; | ||
|
||
protected CsvFields csvFields; | ||
|
||
protected String uri; | ||
|
||
/** | ||
* Gets the value of the csvFields property. | ||
* | ||
* @return | ||
* possible object is | ||
* {@link CsvFields } | ||
* | ||
*/ | ||
public CsvFields getCsvFields() { | ||
return csvFields; | ||
} | ||
|
||
/** | ||
* Sets the value of the csvFields property. | ||
* | ||
* @param value | ||
* allowed object is | ||
* {@link CsvFields } | ||
* | ||
*/ | ||
public void setCsvFields(CsvFields value) { | ||
this.csvFields = value; | ||
} | ||
|
||
/** | ||
* Gets the value of the uri property. | ||
* | ||
* @return | ||
* possible object is | ||
* {@link String } | ||
* | ||
*/ | ||
public String getUri() { | ||
return uri; | ||
} | ||
|
||
/** | ||
* Sets the value of the uri property. | ||
* | ||
* @param value | ||
* allowed object is | ||
* {@link String } | ||
* | ||
*/ | ||
public void setUri(String value) { | ||
this.uri = value; | ||
} | ||
|
||
public boolean equals(Object object) { | ||
if ((object == null)||(this.getClass()!= object.getClass())) { | ||
return false; | ||
} | ||
if (this == object) { | ||
return true; | ||
} | ||
if (!super.equals(object)) { | ||
return false; | ||
} | ||
final CsvComplexType that = ((CsvComplexType) object); | ||
{ | ||
CsvFields leftCsvFields; | ||
leftCsvFields = this.getCsvFields(); | ||
CsvFields rightCsvFields; | ||
rightCsvFields = that.getCsvFields(); | ||
if (this.csvFields!= null) { | ||
if (that.csvFields!= null) { | ||
if (!leftCsvFields.equals(rightCsvFields)) { | ||
return false; | ||
} | ||
} else { | ||
return false; | ||
} | ||
} else { | ||
if (that.csvFields!= null) { | ||
return false; | ||
} | ||
} | ||
} | ||
{ | ||
String leftUri; | ||
leftUri = this.getUri(); | ||
String rightUri; | ||
rightUri = that.getUri(); | ||
if (this.uri!= null) { | ||
if (that.uri!= null) { | ||
if (!leftUri.equals(rightUri)) { | ||
return false; | ||
} | ||
} else { | ||
return false; | ||
} | ||
} else { | ||
if (that.uri!= null) { | ||
return false; | ||
} | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
public int hashCode() { | ||
int currentHashCode = 1; | ||
currentHashCode = ((currentHashCode* 31)+ super.hashCode()); | ||
{ | ||
currentHashCode = (currentHashCode* 31); | ||
CsvFields theCsvFields; | ||
theCsvFields = this.getCsvFields(); | ||
if (this.csvFields!= null) { | ||
currentHashCode += theCsvFields.hashCode(); | ||
} | ||
} | ||
{ | ||
currentHashCode = (currentHashCode* 31); | ||
String theUri; | ||
theUri = this.getUri(); | ||
if (this.uri!= null) { | ||
currentHashCode += theUri.hashCode(); | ||
} | ||
} | ||
return currentHashCode; | ||
} | ||
|
||
} |
100 changes: 100 additions & 0 deletions
100
lib/modules/csv/model/src/main/java/io/atlasmap/csv/v2/CsvFields.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/** | ||
* Copyright (C) 2017 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.atlasmap.csv.v2; | ||
|
||
import java.io.Serializable; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class CsvFields implements Serializable { | ||
|
||
private final static long serialVersionUID = 1L; | ||
|
||
protected List<CsvField> csvField; | ||
|
||
/** | ||
* Gets the value of the csvField property. | ||
* | ||
* <p> | ||
* This accessor method returns a reference to the live list, | ||
* not a snapshot. Therefore any modification you make to the | ||
* returned list will be present inside the JAXB object. | ||
* This is why there is not a <CODE>set</CODE> method for the csvField property. | ||
* | ||
* <p> | ||
* For example, to add a new item, do as follows: | ||
* <pre> | ||
* getCsvField().add(newItem); | ||
* </pre> | ||
* | ||
* | ||
* <p> | ||
* Objects of the following type(s) are allowed in the list | ||
* {@link CsvField } | ||
* | ||
* | ||
*/ | ||
public List<CsvField> getCsvField() { | ||
if (csvField == null) { | ||
csvField = new ArrayList<CsvField>(); | ||
} | ||
return this.csvField; | ||
} | ||
|
||
public boolean equals(Object object) { | ||
if ((object == null)||(this.getClass()!= object.getClass())) { | ||
return false; | ||
} | ||
if (this == object) { | ||
return true; | ||
} | ||
final CsvFields that = ((CsvFields) object); | ||
{ | ||
List<CsvField> leftCsvField; | ||
leftCsvField = (((this.csvField != null)&&(!this.csvField.isEmpty()))?this.getCsvField():null); | ||
List<CsvField> rightCsvField; | ||
rightCsvField = (((that.csvField!= null)&&(!that.csvField.isEmpty()))?that.getCsvField():null); | ||
if ((this.csvField != null)&&(!this.csvField.isEmpty())) { | ||
if ((that.csvField!= null)&&(!that.csvField.isEmpty())) { | ||
if (!leftCsvField.equals(rightCsvField)) { | ||
return false; | ||
} | ||
} else { | ||
return false; | ||
} | ||
} else { | ||
if ((that.csvField!= null)&&(!that.csvField.isEmpty())) { | ||
return false; | ||
} | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
public int hashCode() { | ||
int currentHashCode = 1; | ||
{ | ||
currentHashCode = (currentHashCode* 31); | ||
List<CsvField> theCsvField; | ||
theCsvField = (((this.csvField != null)&&(!this.csvField.isEmpty()))?this.getCsvField():null); | ||
if ((this.csvField != null)&&(!this.csvField.isEmpty())) { | ||
currentHashCode += theCsvField.hashCode(); | ||
} | ||
} | ||
return currentHashCode; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.