- /**
- * Write an InstanceIdentifier into the output stream. Calling corresponding {@link XMLStreamWriter#writeStartElement(String)}
- * and {@link XMLStreamWriter#writeEndElement()} is the responsibility of the caller.
- *
- * @param writer XML Stream writer
- * @param id InstanceIdentifier
- * @throws XMLStreamException
- *
- * @deprecated Use {@link #writeInstanceIdentifier(XMLStreamWriter, YangInstanceIdentifier)} instead.
- */
- @Deprecated
- public static void write(final @Nonnull XMLStreamWriter writer, final @Nonnull YangInstanceIdentifier id) throws XMLStreamException {
- Preconditions.checkNotNull(writer, "Writer may not be null");
- Preconditions.checkNotNull(id, "Variable should contain instance of instance identifier and can't be null");
-
- final RandomPrefix prefixes = new RandomPrefix();
- final String str = XmlUtils.encodeIdentifier(prefixes, id);
- writeNamespaceDeclarations(writer,prefixes.getPrefixes());
- writer.writeCharacters(str);
+ public static XmlStreamUtils create(final XmlCodecProvider codecProvider, final SchemaContext schemaContext) {
+ return new XmlStreamUtils(codecProvider, schemaContext);