class YangTemplate {
- // FIXME: this is not thread-safe and seems to be unused!
- private static var Module module = null
-
def static String generateYangSnipet(SchemaNode schemaNode) {
if (schemaNode == null)
return ''
'''
identity «identity.QName.localName» {
«IF identity.baseIdentity != null»
- base "(«writeIdentityNs(identity.baseIdentity)»)«identity.baseIdentity»";
+ base "()«identity.baseIdentity»";
«ENDIF»
«IF !identity.description.nullOrEmpty»
description
'''
}
- def private static writeIdentityNs(IdentitySchemaNode identity) {
- if(module == null)
- return ''
-
- val identityNs = identity.QName.namespace
-
- if(!module.namespace.equals(identityNs))
- return identityNs + ":"
- return ''
- }
-
def private static writeFeatures(Set<FeatureDefinition> features) {
'''
«FOR feature : features»