Package org.apache.isis.core.commons.xml

Examples of org.apache.isis.core.commons.xml.ContentWriter


        public void startElement(final String ns, final String name, final String tagName, final Attributes attrs) throws SAXException {
            captureValue = tagName.equals("number");
        }

        public ContentWriter writer(final long nextId) {
            return new ContentWriter() {
                @Override
                public void write(final Writer writer) throws IOException {
                    writer.write("<number>");
                    final String nextIdHex = Long.toString(nextId, 16);
                    writer.append("" + nextIdHex);
View Full Code Here


        services.add(element);
        saveServices();
    }

    public final void saveServices() {
        xmlFile.writeXml(SERVICES_FILE_NAME, new ContentWriter() {
            @Override
            public void write(final Writer writer) throws IOException {
                final String tag = SERVICES_FILE_NAME;
                writer.append("<" + tag + ">\n");
                for (final ServiceElement element: services) {
View Full Code Here

    private void writeInstanceFile(final ObjectSpecification noSpec, final Vector<RootOid> instances) {
        writeInstanceFile(noSpec.getFullIdentifier(), instances);
    }

    private void writeInstanceFile(final String name, final Vector<RootOid> instances) {
        xmlFile.writeXml(name, new ContentWriter() {
            @Override
            public void write(final Writer writer) throws IOException {
                writer.write("<instances");
                Utils.appendAttribute(writer, "name", name);
                writer.append(">\n");
View Full Code Here

    public final void save(final Data data) {
        writeInstanceToItsDataFile(data);
    }

    private void writeInstanceToItsDataFile(final Data data) {
        xmlFile.writeXml(filename(data.getRootOid()), new ContentWriter() {
            @Override
            public void write(final Writer writer) throws IOException {
                final boolean isObject = data instanceof ObjectData;
                final String tag = isObject ? "isis" : "collection";
                writer.write("<");
View Full Code Here

     */
    protected long nextId() throws PersistorException {
        final NumberHandler handler = new NumberHandler();
        xmlFile.parse(handler, "oid");

        xmlFile.writeXml("oid", new ContentWriter() {
            @Override
            public void write(final Writer writer) throws IOException {
                final StringBuffer data = new StringBuffer();
                data.append("<number>");
                data.append(handler.value + 1);
View Full Code Here

    private void writeInstanceFile(final ObjectSpecification noSpec, final Vector<SerialOid> instances) {
        writeInstanceFile(noSpec.getFullIdentifier(), instances);
    }

    private void writeInstanceFile(final String name, final Vector<SerialOid> instances) {
        xmlFile.writeXml(name, new ContentWriter() {
            @Override
            public void write(final Writer writer) throws IOException {
                final StringBuffer data = new StringBuffer();
                data.append("<instances name=\"" + name + "\">\n");
                for (final SerialOid elementAt : instances) {
View Full Code Here

    public final void save(final Data data) {
        writeInstanceToItsDataFile(data);
    }

    private void writeInstanceToItsDataFile(final Data data) {
        xmlFile.writeXml(filename(data.getOid()), new ContentWriter() {
            @Override
            public void write(final Writer writer) throws IOException {
                final StringBuffer xml = new StringBuffer();
                final boolean isObject = data instanceof ObjectData;
                final String tag = isObject ? "isis" : "collection";
View Full Code Here

        services.addElement(element);
        saveServices();
    }

    public final void saveServices() {
        xmlFile.writeXml(SERVICES_FILE_NAME, new ContentWriter() {
            @Override
            public void write(final Writer writer) throws IOException {
                final String tag = SERVICES_FILE_NAME;
                writer.append("<" + tag + ">\n");
                for (final Enumeration e = services.elements(); e.hasMoreElements();) {
View Full Code Here

     */
    protected long nextId() throws PersistorException {
        final NumberHandler handler = new NumberHandler();
        xmlFile.parse(handler, "oid");

        xmlFile.writeXml("oid", new ContentWriter() {
            @Override
            public void write(final Writer writer) throws IOException {
                final StringBuffer data = new StringBuffer();
                data.append("<number>");
                data.append(handler.value + 1);
View Full Code Here

    private void writeInstanceFile(final ObjectSpecification noSpec, final Vector<SerialOid> instances) {
        writeInstanceFile(noSpec.getFullIdentifier(), instances);
    }

    private void writeInstanceFile(final String name, final Vector<SerialOid> instances) {
        xmlFile.writeXml(name, new ContentWriter() {
            @Override
            public void write(final Writer writer) throws IOException {
                final StringBuffer data = new StringBuffer();
                data.append("<instances name=\"" + name + "\">\n");
                for (final SerialOid elementAt : instances) {
View Full Code Here

TOP

Related Classes of org.apache.isis.core.commons.xml.ContentWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.