Class CompactNodeTypeDefWriter

  • Direct Known Subclasses:
    CompactNodeTypeDefWriter

    public class CompactNodeTypeDefWriter
    extends java.lang.Object
    Prints node type defs in a compact notation Print Format: <ex = "http://apache.org/jackrabbit/example"> [ex:NodeType] > ex:ParentType1, ex:ParentType2 orderable mixin - ex:property (STRING) = 'default1', 'default2' primary mandatory autocreated protected multiple VERSION < 'constraint1', 'constraint2' + ex:node (ex:reqType1, ex:reqType2) = ex:defaultType mandatory autocreated protected multiple VERSION
    • Constructor Detail

      • CompactNodeTypeDefWriter

        public CompactNodeTypeDefWriter​(java.io.Writer out,
                                        Session session,
                                        boolean includeNS)
        Creates a new nodetype writer based on a session
        Parameters:
        out - the underlying writer
        session - repository session
        includeNS - if true all used namespace decl. are also written to the writer
      • CompactNodeTypeDefWriter

        public CompactNodeTypeDefWriter​(java.io.Writer out,
                                        CompactNodeTypeDefWriter.NamespaceMapping nsMapping,
                                        boolean includeNS)
        Creates a new nodetype writer based on a session
        Parameters:
        out - the underlying writer
        nsMapping - the mapping from prefix to namespace URI.
        includeNS - if true all used namespace decl. are also written to the writer
    • Method Detail

      • write

        public static void write​(java.util.Collection<NodeTypeDefinition> defs,
                                 Session session,
                                 java.io.Writer out)
                          throws java.io.IOException
        Writes the given list of QNodeTypeDefinition to the output writer including the used namespaces.
        Parameters:
        defs - collection of definitions
        session - session
        out - output writer
        Throws:
        java.io.IOException - if an I/O error occurs
      • write

        public static void write​(java.util.Collection<NodeTypeDefinition> defs,
                                 CompactNodeTypeDefWriter.NamespaceMapping nsMapping,
                                 java.io.Writer out)
                          throws java.io.IOException
        Writes the given list of QNodeTypeDefinition to the output writer including the used namespaces.
        Parameters:
        defs - collection of definitions
        nsMapping - the mapping from prefix to namespace URI.
        out - output writer
        Throws:
        java.io.IOException - if an I/O error occurs
      • write

        public void write​(NodeTypeDefinition ntd)
                   throws java.io.IOException
        Write one NodeTypeDefinition to this writer
        Parameters:
        ntd - node type definition
        Throws:
        java.io.IOException - if an I/O error occurs
      • writeNamespaceDeclaration

        public void writeNamespaceDeclaration​(java.lang.String prefix)
                                       throws java.io.IOException
        Write a namespace declaration to this writer. Note, that this method has no effect if there is no extra namespace write present.
        Parameters:
        prefix - namespace prefix
        Throws:
        java.io.IOException - if an I/O error occurs
      • close

        public void close()
                   throws java.io.IOException
        Flushes all pending write operations and Closes this writer. please note, that the underlying writer remains open.
        Throws:
        java.io.IOException - if an I/O error occurs