Java parser for metadata presented according to LIDO XML Schema
JDK 11+ or OpenJDK 11+
Maven 3.x
- Download and install JDK 11 or OpenJDK 11 (or newer versions)
- Download and install Maven 3.x
- Clone the repository:
git clone https://github.com/iliedorobat/LIDO-Parser.git
- Generate the library:
mvn validate && mvn clean package
java -jar target/LIDO-Parser-1.1-jar-with-dependencies.jar
public class LidoWrapProcessing {
private static final ParserDAO parserDAO = new ParserDAOImpl();
public static void parse(String fullPath) {
LidoWrap lidoWrap = parserDAO.parseLidoFile(fullPath);
// Get the list of "lido" elements
ArrayList<Lido> lidoList = lidoWrap.getLidoList();
for (Lido lido : lidoList) {
ArrayList<LidoRecID> lidoRecIDList = lido.getLidoRecID();
Category category = lido.getCategory();
ArrayList<AdministrativeMetadata> administrativeMetadataList = lido.getAdministrativeMetadata();
ArrayList<DescriptiveMetadata> descriptiveMetadataList = lido.getDescriptiveMetadata();
// then, you can go deeper to extract administrative/descriptive data, categories and lido ids
}
}
}
public class LidoWrapProcessing {
private static final ParserDAO parserDAO = new ParserDAOImpl();
public static void serialize(String inputFullPath, outputPath) {
LidoWrap lidoWrap = parserDAO.parseLidoFile(inputFullPath);
ObjectMapper mapper = new ObjectMapper();
try {
mapper.writeValue(new File(outputPath), lidoWrap);
} catch (IOException e) {
e.printStackTrace();
}
}
}