We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am reading information from a Xml.Tag via the XmlIsoVisitor.visitTag method. I have to read the value of a specific attribute.
Xml.Tag
XmlIsoVisitor.visitTag
Right now, this is harder than it needs to be.
List<Xml.Attribute> attributes = tag.getAttributes(); String attributeValue = getAttributeValue(attributes, "myattribute"); private String getAttributeValue(List<Xml.Attribute> attributes, String attributeName) { Optional<Xml.Attribute> attribute = attributes.stream().filter(a -> attributeName.equals(a.getKeyAsString())).findFirst(); return attribute.map(Xml.Attribute::getValueAsString).orElse(null); }
I'd like to see a convenience method that does something similar to getAttributeValue. Is this something you'd consider?
getAttributeValue
Yes, see method above.
N/A
Yes
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What problem are you trying to solve?
I am reading information from a
Xml.Tag
via theXmlIsoVisitor.visitTag
method. I have to read the value of a specific attribute.Right now, this is harder than it needs to be.
Describe the solution you'd like
I'd like to see a convenience method that does something similar to
getAttributeValue
. Is this something you'd consider?Have you considered any alternatives or workarounds?
Yes, see method above.
Additional context
N/A
Are you interested in [contributing this feature to OpenRewrite]
Yes
The text was updated successfully, but these errors were encountered: