Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 5 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Test framework: **NUnit**. Test classes use `[TestFixture]` and `[Test]` attribu
Most code in this repo is **auto-generated** — files marked `THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!` must not be edited directly.

The pipeline:
1. **Input**: `Resources/KerML_only_xmi.uml` and `Resources/SysML_only_xmi.uml` (UML XMI metamodel files)
1. **Input**: `Resources/KerML_only_xmi.uml` and `Resources/SysML_only_xmi.uml` — these two UML-based XMI files define the KerML and SysML v2 specification respectively. They are the **single source of truth** for all generated DTOs, POCOs, serializers, extension methods, and other auto-generated code. All OCL constraints (derivation rules, validation invariants, and operation body conditions) for each metaclass are also defined within these XMI files.
2. **Generator**: `SysML2.NET.CodeGenerator` reads these via `uml4net.xmi`, uses Handlebars templates (`Templates/Uml/*.hbs`) to generate code
3. **Output**: `AutoGen*` directories across multiple projects

Expand Down Expand Up @@ -114,3 +114,7 @@ Auto-generated DTOs use structured namespaces reflecting the KerML/SysML package

- Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
- Use 'StringBuilder.Append(char)' instead of 'StringBuilder.Append(string)' when the input is a constant unit string
- Prefer 'string.IsNullOrWhiteSpace' over 'string.IsNullOrEmpty' when checking the non-nullable value of a string
- Prefer switch expressions/statements over if-else chains when applicable
- Prefer indexer syntax (e.g., 'list[^1]') and range syntax (e.g., 'array[1..^1]') over LINQ methods (e.g., 'list.Last()', 'list.Skip(1).Take(n)') when applicable
- Use meaningful variable names instead of single-letter names in any context (e.g., 'charIndex' instead of 'i', 'currentChar' instead of 'c', 'element' instead of 'e')
2 changes: 1 addition & 1 deletion SySML2.NET.REST.Tests/SySML2.NET.REST.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
<PackageReference Include="NUnit" Version="4.5.1" />
<PackageReference Include="NUnit.Console" Version="3.22.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,56 @@ public AnnotatingElement()
[Implements(implementation: "IElement.TextualRepresentation")]
public List<ITextualRepresentation> textualRepresentation => this.ComputeTextualRepresentation();


/// <summary>
/// Return an effective name for this Element. By default this is the same as its declaredName.
/// </summary>
/// <returns>
/// The expected <see cref="string" />
/// </returns>
public string EffectiveName() => this.ComputeEffectiveNameOperation();

/// <summary>
/// Return an effective shortName for this Element. By default this is the same as its
/// declaredShortName.
/// </summary>
/// <returns>
/// The expected <see cref="string" />
/// </returns>
public string EffectiveShortName() => this.ComputeEffectiveShortNameOperation();

/// <summary>
/// Return name, if that is not null, otherwise the shortName, if that is not null, otherwise null. If
/// the returned value is non-null, it is returned as-is if it has the form of a basic name, or,
/// otherwise, represented as a restricted name according to the lexical structure of the KerML textual
/// notation (i.e., surrounded by single quote characters and with special characters escaped).
/// </summary>
/// <returns>
/// The expected <see cref="string" />
/// </returns>
public string EscapedName() => this.ComputeEscapedNameOperation();

/// <summary>
/// By default, return the library Namespace of the owningRelationship of this Element, if it has one.
/// </summary>
/// <returns>
/// The expected <see cref="INamespace" />
/// </returns>
public INamespace LibraryNamespace() => this.ComputeLibraryNamespaceOperation();

/// <summary>
/// Return a unique description of the location of this Element in the containment structure rooted in a
/// root Namespace. If the Element has a non-null qualifiedName, then return that. Otherwise, if it has
/// an owningRelationship, then return the string constructed by appending to the path of it's
/// owningRelationship the character / followed by the string representation of its position in the list
/// of ownedRelatedElements of the owningRelationship (indexed starting at 1). Otherwise, return the
/// empty string. (Note that this operation is overridden for Relationships
/// to use owningRelatedElement when appropriate.)
/// </summary>
/// <returns>
/// The expected <see cref="string" />
/// </returns>
public string Path() => this.ComputePathOperation();
}
}

Expand Down
Loading
Loading