public Type getType(final LeafSchemaNode leaf) { TypeDefinition<?> type = CompatUtils.compatLeafType(leaf); return getType(leaf, type); }
public JavaAttribute(final LeafListSchemaNode leaf, final TypeProviderWrapper typeProviderWrapper) { super(leaf); this.type = typeProviderWrapper.getType(leaf); this.typeDefinition = leaf.getType(); this.typeProviderWrapper = typeProviderWrapper; this.nullableDefault = nullableDefaultWrappedForCode = null; this.nullableDescription = leaf.getDescription(); }
private OpenType<?> getEnumType(final TypeDefinition<?> baseType) { final String fullyQualifiedName = typeProviderWrapper.getType(node, getTypeDefinition()).getFullyQualifiedName(); final String[] items = {"instance"}; String description = getNullableDescription() == null ? getAttributeYangName() : getNullableDescription(); try { return new CompositeType(fullyQualifiedName, description, items, items, new OpenType[]{SimpleType.STRING}); } catch (OpenDataException e) { throw new RuntimeException("Unable to create enum type" + fullyQualifiedName + " as open type", e); } }
public JavaAttribute(final LeafSchemaNode leaf, final TypeProviderWrapper typeProviderWrapper) { super(leaf); this.type = typeProviderWrapper.getType(leaf); this.typeDefinition = CompatUtils.compatLeafType(leaf); this.typeProviderWrapper = typeProviderWrapper; this.nullableDefault = leaf.getDefault(); this.nullableDefaultWrappedForCode = leaf.getDefault() == null ? null : typeProviderWrapper.getDefault(leaf); this.nullableDescription = leaf.getDescription(); }
@Override public OpenType<?> getOpenType() { TypeDefinition<?> baseTypeDefinition = getBaseType(typeProviderWrapper, typeDefinition); Type baseType = typeProviderWrapper.getType(baseTypeDefinition, baseTypeDefinition); if (isArray()) { return getArrayType(); } else if (isEnum()) { return getEnumType(baseTypeDefinition); } else if (isUnion()) { return getCompositeTypeForUnion(baseTypeDefinition); } else if (isDerivedType(baseType, getType())) { return getCompositeType(baseType, baseTypeDefinition); } else if (isIdentityRef()) { return getCompositeTypeForIdentity(); } return getSimpleType(getType()); }