Skip to content

Commit

Permalink
Slight syntax cleanup in template parser proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
hugithordarson committed Nov 17, 2024
1 parent 5fba637 commit 0aa738c
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class NGTemplateParserProxy {
* @param htmlString The HTML to parse
* @param wodString The associated wod/declarations
*/
public NGTemplateParserProxy( String htmlString, String wodString ) {
public NGTemplateParserProxy( final String htmlString, final String wodString ) {
Objects.requireNonNull( htmlString );
Objects.requireNonNull( wodString );

Expand Down Expand Up @@ -60,7 +60,7 @@ private static NGElement toDynamicElement( final PNode node ) {
private static NGElement toDynamicElement( final PBasicNode node ) {

final String type = node.type();
final Map<String, NGAssociation> associations = associationsFromDeclaration( node.bindings(), node.isInline() );
final Map<String, NGAssociation> associations = toAssociations( node.bindings(), node.isInline() );
final NGElement childTemplate = toTemplate( node.children() );

try {
Expand All @@ -73,11 +73,13 @@ private static NGElement toDynamicElement( final PBasicNode node ) {
}
}

private static Map<String, NGAssociation> associationsFromDeclaration( final Map<String, NGBindingValue> bindings, final boolean isInline ) {
private static Map<String, NGAssociation> toAssociations( final Map<String, NGBindingValue> bindings, final boolean isInline ) {
final Map<String, NGAssociation> associations = new HashMap<>();

for( Entry<String, NGBindingValue> entry : bindings.entrySet() ) {
associations.put( entry.getKey(), NGAssociationFactory.toAssociation( entry.getValue(), isInline ) );
final String bindingName = entry.getKey();
final NGAssociation association = NGAssociationFactory.toAssociation( entry.getValue(), isInline );
associations.put( bindingName, association );
}

return associations;
Expand Down

0 comments on commit 0aa738c

Please sign in to comment.