public class AttributeNameConverter extends Object
AttributeNameConverter is Projo's way of converting XML/SGML attribute names
to method names. The basic implementation converts from kebab-case to camel-case (e.g.,
data-widget-id becomes dataWidgetId). It also treats XML namespace separators
:) as word delimiters (e.g., xml:base will be converted to xmlBase. However,
it does not escape Java keywords, which means its implementation may not necessarily be suitable
for generating Java APIs as the generated code may contain method names like class, etc.
For that purpose, the DefaultAttributeNameConverter may be a better choice (and
is also the default choice if no other AttributeNameConverter is specified).| Constructor and Description |
|---|
AttributeNameConverter() |
| Modifier and Type | Method and Description |
|---|---|
String |
convertAttributeName(String name)
Converts an SGML or XML attribute name to a Java-style method or field name.
|
Copyright © 2024. All rights reserved.