Skip to content

Commit

Permalink
Nicer method of checking for a tag alias
Browse files Browse the repository at this point in the history
  • Loading branch information
hugithordarson committed Nov 25, 2024
1 parent c030b3a commit 9619489
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions ng-appserver/src/main/java/ng/appserver/NGApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -703,20 +703,10 @@ public static NGElement dynamicElementWithName( final String identifier, final M
Objects.requireNonNull( associations );
Objects.requireNonNull( languages );

final String name;
// First we're going to check if we have a tag alias present.
final String name = NGElementUtils.tagShortcutMap().getOrDefault( identifier, identifier );

// First we're going to check if we have a tag alias present
final String shortName = NGElementUtils.tagShortcutMap().get( identifier );

if( shortName != null ) {
name = shortName;
}
else {
// If no shortcut is present for the given identifier, use the original identifier
name = identifier;
}

// First we locate the class of the element we're going to render.
// Check if we can find a class representing the element we're going to render.
final Class<? extends NGElement> elementClass = NGElementUtils.classWithNameNullIfNotFound( name );

// If we don't find a class for the element, we're going to try going down the route of a classless component.
Expand Down

0 comments on commit 9619489

Please sign in to comment.