Skip to content

Commit

Permalink
Implement NodeNameValueProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
eschleb committed Mar 12, 2024
1 parent 699ca76 commit f9f9fe2
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.namics.oss.magnolia.appbuilder.formatter;

import javax.jcr.Node;
import javax.jcr.RepositoryException;
import java.util.Optional;

public class NodeNameValueProvider extends AbstractValueProvider {
@Override
protected Optional<String> getValue(final Node node) {
try {
return Optional.ofNullable(node.getName());
} catch (RepositoryException e) {
return Optional.empty();
}
}
}

0 comments on commit f9f9fe2

Please sign in to comment.