/** * Get the constructor to construct the Node. For implicit tags if the * runtime class is known a dedicated Construct implementation is used. * Otherwise the constructor is chosen by the tag. * * @param node {@link Node} to construct an instance from * @return {@link Construct} implementation for the specified node */ protected Construct getConstructor(Node node) { if (node.useClassConstructor()) { return yamlClassConstructors.get(node.getNodeId()); } else { Construct constructor = yamlConstructors.get(node.getTag()); if (constructor == null) { for (String prefix : yamlMultiConstructors.keySet()) { if (node.getTag().startsWith(prefix)) { return yamlMultiConstructors.get(prefix); } } return yamlConstructors.get(null); } return constructor; } }
/** * Get the constructor to construct the Node. For implicit tags if the * runtime class is known a dedicated Construct implementation is used. * Otherwise the constructor is chosen by the tag. * * @param node * Node to be constructed * @return Construct implementation for the specified node */ protected Construct getConstructor(Node node) { if (node.useClassConstructor()) { return yamlClassConstructors.get(node.getNodeId()); } else { Construct constructor = yamlConstructors.get(node.getTag()); if (constructor == null) { for (String prefix : yamlMultiConstructors.keySet()) { if (node.getTag().startsWith(prefix)) { return yamlMultiConstructors.get(prefix); } } return yamlConstructors.get(null); } return constructor; } }
/** * Get the constructor to construct the Node. For implicit tags if the * runtime class is known a dedicated Construct implementation is used. * Otherwise the constructor is chosen by the tag. * * @param node * Node to be constructed * @return Construct implementation for the specified node */ protected Construct getConstructor(Node node) { if (node.useClassConstructor()) { return yamlClassConstructors.get(node.getNodeId()); } else { Construct constructor = yamlConstructors.get(node.getTag()); if (constructor == null) { for (String prefix : yamlMultiConstructors.keySet()) { if (node.getTag().startsWith(prefix)) { return yamlMultiConstructors.get(prefix); } } return yamlConstructors.get(null); } return constructor; } }
/** * Get the constructor to construct the Node. For implicit tags if the * runtime class is known a dedicated Construct implementation is used. * Otherwise the constructor is chosen by the tag. * * @param node * Node to be constructed * @return Construct implementation for the specified node */ protected Construct getConstructor(Node node) { if (node.useClassConstructor()) { return yamlClassConstructors.get(node.getNodeId()); } else { Construct constructor = yamlConstructors.get(node.getTag()); if (constructor == null) { for (String prefix : yamlMultiConstructors.keySet()) { if (node.getTag().startsWith(prefix)) { return yamlMultiConstructors.get(prefix); } } return yamlConstructors.get(null); } return constructor; } }