- // underscore used as separator for distinction of method parts in convertIdentifier()
- method.append('_').append(localName);
- return JavaIdentifierNormalizer.normalizeSpecificIdentifier(method.toString(), JavaIdentifier.METHOD);
- }
-
- static String createDescription(final SchemaNode schemaNode, final String fullyQualifiedName,
- final SchemaContext schemaContext, final boolean verboseClassComments) {
- final StringBuilder sb = new StringBuilder();
- final String nodeDescription = encodeAngleBrackets(schemaNode.getDescription());
- final String formattedDescription = YangTextTemplate.formatToParagraph(nodeDescription, 0);
-
- if (!Strings.isNullOrEmpty(formattedDescription)) {
- sb.append(formattedDescription);
- sb.append(NEW_LINE);
- }
-
- if (verboseClassComments) {
- final Module module = SchemaContextUtil.findParentModule(schemaContext, schemaNode);
- final StringBuilder linkToBuilderClass = new StringBuilder();
- final String[] namespace = Iterables.toArray(BSDOT_SPLITTER.split(fullyQualifiedName), String.class);
- final String className = namespace[namespace.length - 1];
-
- if (hasBuilderClass(schemaNode)) {
- linkToBuilderClass.append(className);
- linkToBuilderClass.append("Builder");
- }
-
- sb.append("<p>");
- sb.append("This class represents the following YANG schema fragment defined in module <b>");
- sb.append(module.getName());
- sb.append("</b>");
- sb.append(NEW_LINE);
- sb.append("<pre>");
- sb.append(NEW_LINE);
- String formedYang = YangSnippetCleaner.clean(yangTemplateForNode.render(schemaNode, module).body());
- sb.append(encodeAngleBrackets(formedYang));
- sb.append("</pre>");
- sb.append(NEW_LINE);
- sb.append("The schema path to identify an instance is");
- sb.append(NEW_LINE);
- sb.append("<i>");
- sb.append(YangTextTemplate.formatSchemaPath(module.getName(), schemaNode.getPath().getPathFromRoot()));
- sb.append("</i>");
- sb.append(NEW_LINE);
-
- if (hasBuilderClass(schemaNode) && !(schemaNode instanceof OperationDefinition)) {
- sb.append(NEW_LINE);
- sb.append("<p>To create instances of this class use " + "{@link " + linkToBuilderClass + "}.");
- sb.append(NEW_LINE);
- sb.append("@see ");
- sb.append(linkToBuilderClass);
- sb.append(NEW_LINE);
- if (schemaNode instanceof ListSchemaNode) {
- final List<QName> keyDef = ((ListSchemaNode)schemaNode).getKeyDefinition();
- if (keyDef != null && !keyDef.isEmpty()) {
- sb.append("@see ");
- sb.append(className);
- sb.append("Key");
- }
- sb.append(NEW_LINE);
- }
- }
- }
-
- return replaceAllIllegalChars(sb);
- }
-
- static String createDescription(final Module module, final boolean verboseClassComments) {
- final StringBuilder sb = new StringBuilder();
- final String moduleDescription = encodeAngleBrackets(module.getDescription());
- final String formattedDescription = YangTextTemplate.formatToParagraph(moduleDescription, 0);
-
- if (!Strings.isNullOrEmpty(formattedDescription)) {
- sb.append(formattedDescription);
- sb.append(NEW_LINE);
- }
-
- if (verboseClassComments) {
- sb.append("<p>");
- sb.append("This class represents the following YANG schema fragment defined in module <b>");
- sb.append(module.getName());
- sb.append("</b>");
- sb.append(NEW_LINE);
- sb.append("<pre>");
- sb.append(NEW_LINE);
- String formedYang = YangSnippetCleaner.clean(yangTemplateForModule.render(module).body());
- sb.append(encodeAngleBrackets(formedYang));
- sb.append("</pre>");
- }
-
- return replaceAllIllegalChars(sb);