- public XmlCodec<?> load(@Nonnull final Entry<DataSchemaNode, NamespaceContext> schemaNodeAndNamespaceCtxPair)
- throws Exception {
- final DataSchemaNode schemaNode = schemaNodeAndNamespaceCtxPair.getKey();
- final TypeDefinition<?> type;
- if (schemaNode instanceof LeafSchemaNode) {
- type = ((LeafSchemaNode) schemaNode).getType();
- } else if (schemaNode instanceof LeafListSchemaNode) {
- type = ((LeafListSchemaNode) schemaNode).getType();
- } else {
- throw new IllegalArgumentException("Not supported node type " + schemaNode.getClass().getName());
- }
- return createCodec(schemaNode,type, schemaNodeAndNamespaceCtxPair.getValue());
+ public XmlCodec<?> load(@Nonnull final Entry<TypedSchemaNode, NamespaceContext> pair) {
+ final TypedSchemaNode schemaNode = pair.getKey();
+ final TypeDefinition<?> type = schemaNode.getType();
+ return createCodec(schemaNode, type, pair.getValue());