-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Add Support for unit, min and max attributes of Specification
- Loading branch information
Showing
16 changed files
with
19,263 additions
and
184 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
28 changes: 28 additions & 0 deletions
28
vss-processor/src/main/kotlin/org/eclipse/kuksa/vssprocessor/parser/FileParseException.kt
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,28 @@ | ||
/* | ||
* Copyright (c) 2023 - 2024 Contributors to the Eclipse Foundation | ||
* | ||
* 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. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
package org.eclipse.kuksa.vssprocessor.parser | ||
|
||
/** | ||
* Will be thrown when an error occurred while parsing a File. | ||
*/ | ||
class FileParseException( | ||
override val message: String? = null, | ||
override val cause: Throwable? = null, | ||
) : Exception(message, cause) |
44 changes: 44 additions & 0 deletions
44
vss-processor/src/main/kotlin/org/eclipse/kuksa/vssprocessor/parser/SharedKeys.kt
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,44 @@ | ||
/* | ||
* Copyright (c) 2023 - 2024 Contributors to the Eclipse Foundation | ||
* | ||
* 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. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
package org.eclipse.kuksa.vssprocessor.parser | ||
|
||
const val ROOT_KEY_VEHICLE = "Vehicle" | ||
|
||
const val KEY_DATA_DESCRIPTION = "description" | ||
const val KEY_DATA_TYPE = "type" | ||
const val KEY_DATA_UUID = "uuid" | ||
const val KEY_DATA_COMMENT = "comment" | ||
const val KEY_DATA_DATATYPE = "datatype" | ||
const val KEY_DATA_UNIT = "unit" | ||
const val KEY_DATA_MIN = "min" | ||
const val KEY_DATA_MAX = "max" | ||
const val KEY_DATA_CHILDREN = "children" | ||
|
||
val VSS_DATA_KEYS = listOf( | ||
KEY_DATA_DESCRIPTION, | ||
KEY_DATA_TYPE, | ||
KEY_DATA_UUID, | ||
KEY_DATA_COMMENT, | ||
KEY_DATA_UNIT, | ||
KEY_DATA_DATATYPE, | ||
KEY_DATA_MIN, | ||
KEY_DATA_MAX, | ||
KEY_DATA_CHILDREN, | ||
) |
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
53 changes: 53 additions & 0 deletions
53
vss-processor/src/main/kotlin/org/eclipse/kuksa/vssprocessor/spec/VssNodeProperty.kt
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,53 @@ | ||
/* | ||
* Copyright (c) 2023 - 2024 Contributors to the Eclipse Foundation | ||
* | ||
* 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. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
package org.eclipse.kuksa.vssprocessor.spec | ||
|
||
import kotlin.reflect.KClass | ||
|
||
open class VssNodeProperty( | ||
val vssPath: String, | ||
val nodePropertyName: String, | ||
val nodePropertyValue: String, | ||
val dataType: KClass<*>, | ||
) { | ||
open val isCommon: Boolean = true | ||
|
||
override fun equals(other: Any?): Boolean { | ||
if (this === other) return true | ||
if (javaClass != other?.javaClass) return false | ||
|
||
other as VssNodeProperty | ||
|
||
return nodePropertyName == other.nodePropertyName | ||
} | ||
|
||
override fun hashCode(): Int { | ||
return nodePropertyName.hashCode() | ||
} | ||
} | ||
|
||
class VssSignalProperty( | ||
vssPath: String, | ||
nodePropertyName: String, | ||
nodePropertyValue: String, | ||
dataType: KClass<*>, | ||
) : VssNodeProperty(vssPath, nodePropertyName, nodePropertyValue, dataType) { | ||
override val isCommon: Boolean = false | ||
} |
Oops, something went wrong.