Package org.marc4j.marc

Examples of org.marc4j.marc.MarcFactory


        assertTrue(agency.matches("DLC"));
       
    }
   
    public void testCreateRecord() throws Exception {
        MarcFactory factory = MarcFactory.newInstance();
        Record record = factory.newRecord("00000cam a2200000 a 4500");
        assertEquals("00000cam a2200000 a 4500", record.getLeader().marshal());

        record.addVariableField(factory.newControlField("001", "12883376"));
       
        DataField df = factory.newDataField("245", '1', '0');
        df.addSubfield(factory.newSubfield('a', "Summerland /"));
        df.addSubfield(factory.newSubfield('c', "Michael Chabon."));
        record.addVariableField(df);
    }
View Full Code Here


        assertTrue(agency.matches("DLC"));

    }

    public void testCreateRecord() throws Exception {
        MarcFactory factory = MarcFactory.newInstance();
        Record record = factory.newRecord("00000cam a2200000 a 4500");
        assertEquals("00000cam a2200000 a 4500", record.getLeader().marshal());

        record.addVariableField(factory.newControlField("001", "12883376"));

        DataField df = factory.newDataField("245", '1', '0');
        df.addSubfield(factory.newSubfield('a', "Summerland /"));
        df.addSubfield(factory.newSubfield('c', "Michael Chabon."));
        record.addVariableField(df);
    }
View Full Code Here

    public static void main(String args[]) throws Exception {

        InputStream input = AddLocationExample.class
                .getResourceAsStream("resources/summerland.mrc");

        MarcFactory factory = MarcFactory.newInstance();

        MarcReader reader = new MarcStreamReader(input);
        while (reader.hasNext()) {
            Record record = reader.next();

            DataField field = factory.newDataField("856", '4', '2');
            field.addSubfield(factory.newSubfield('3',
                "Contributor biographical information"));
            field.addSubfield(factory.newSubfield('u',
                "http://en.wikipedia.org/wiki/Michael_Chabon"));
            record.addVariableField(field);

            System.out.println(record.toString());
        }
View Full Code Here

TOP

Related Classes of org.marc4j.marc.MarcFactory

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.