Repository: any23 Updated Branches: refs/heads/master d66e7dbb9 -> b2a33ff82
ANY23-akn Project: http://git-wip-us.apache.org/repos/asf/any23/repo Commit: http://git-wip-us.apache.org/repos/asf/any23/commit/f07bdbf3 Tree: http://git-wip-us.apache.org/repos/asf/any23/tree/f07bdbf3 Diff: http://git-wip-us.apache.org/repos/asf/any23/diff/f07bdbf3 Branch: refs/heads/master Commit: f07bdbf32089fdc7b0f3d20be7a3fb9ced38e89c Parents: 4d303c9 Author: Lewis John McGibbney <[email protected]> Authored: Thu Mar 13 21:21:46 2014 +0000 Committer: Lewis John McGibbney <[email protected]> Committed: Thu Mar 13 21:21:46 2014 +0000 ---------------------------------------------------------------------- .../any23/extractor/akn/AKNExtractor.java | 50 ++++++++++++++++++ .../extractor/akn/AKNExtractorFactory.java | 54 ++++++++++++++++++++ .../apache/any23/extractor/akn/AKNParser.java | 33 ++++++++++++ .../any23/extractor/akn/package-info.java | 27 ++++++++++ 4 files changed, 164 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/any23/blob/f07bdbf3/core/src/main/java/org/apache/any23/extractor/akn/AKNExtractor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/any23/extractor/akn/AKNExtractor.java b/core/src/main/java/org/apache/any23/extractor/akn/AKNExtractor.java new file mode 100644 index 0000000..e637276 --- /dev/null +++ b/core/src/main/java/org/apache/any23/extractor/akn/AKNExtractor.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.any23.extractor.akn; + +import java.io.IOException; + +import org.apache.any23.extractor.ExtractionContext; +import org.apache.any23.extractor.ExtractionException; +import org.apache.any23.extractor.ExtractionParameters; +import org.apache.any23.extractor.ExtractionResult; +import org.apache.any23.extractor.Extractor; +import org.apache.any23.extractor.ExtractorDescription; +import org.w3c.dom.Document; + +/** + * Extractor for the <a href="http://www.akomtantoso.org">Akoma Ntoso</a> + * XML Format. + * @author lewismc + * + */ +public class AKNExtractor implements Extractor.TagSoupDOMExtractor { + + @Override + public void run(ExtractionParameters extractionParameters, ExtractionContext context, Document in, + ExtractionResult out) throws IOException, ExtractionException { + // TODO Auto-generated method stub + + } + + @Override + public ExtractorDescription getDescription() { + // TODO Auto-generated method stub + return null; + } + +} http://git-wip-us.apache.org/repos/asf/any23/blob/f07bdbf3/core/src/main/java/org/apache/any23/extractor/akn/AKNExtractorFactory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/any23/extractor/akn/AKNExtractorFactory.java b/core/src/main/java/org/apache/any23/extractor/akn/AKNExtractorFactory.java new file mode 100644 index 0000000..bbd0a87 --- /dev/null +++ b/core/src/main/java/org/apache/any23/extractor/akn/AKNExtractorFactory.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.any23.extractor.akn; + +import java.util.Arrays; + +import org.apache.any23.extractor.ExtractorDescription; +import org.apache.any23.extractor.ExtractorFactory; +import org.apache.any23.extractor.SimpleExtractorFactory; +import org.apache.any23.rdf.PopularPrefixes; +import org.apache.any23.rdf.Prefixes; +import org.kohsuke.MetaInfServices; + +/** + * @author lewismc + * + */ +@MetaInfServices(ExtractorFactory.class) +public class AKNExtractorFactory extends SimpleExtractorFactory<AKNExtractor> implements + ExtractorFactory<AKNExtractor> { + + private static final ExtractorDescription descriptionInstance = new AKNExtractorFactory(); + private static final String NAME = "akomaNtoso"; + private static final Prefixes PREFIXES = PopularPrefixes.createSubset("akn", "AKN", "AKOMA"); + + public AKNExtractorFactory() { + super(AKNExtractorFactory.NAME, + AKNExtractorFactory.PREFIXES); + } + + @Override + public AKNExtractor createExtractor() { + return new AKNExtractor(); + } + + public static ExtractorDescription getDescriptionInstance() { + return descriptionInstance; + } +} http://git-wip-us.apache.org/repos/asf/any23/blob/f07bdbf3/core/src/main/java/org/apache/any23/extractor/akn/AKNParser.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/any23/extractor/akn/AKNParser.java b/core/src/main/java/org/apache/any23/extractor/akn/AKNParser.java new file mode 100644 index 0000000..2320da2 --- /dev/null +++ b/core/src/main/java/org/apache/any23/extractor/akn/AKNParser.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.any23.extractor.akn; + +/** + * This class provides utility methods for handling <b>Akoma Ntoso</b> + * nodes contained within a <i>DOM</i> document. + * @author lewismc + */ +public class AKNParser { + + enum ErrorMode { + /** This mode raises an exception at first encountered error. */ + StopAtFirstError, + /** This mode produces a full error report. */ + FullReport + } + +} http://git-wip-us.apache.org/repos/asf/any23/blob/f07bdbf3/core/src/main/java/org/apache/any23/extractor/akn/package-info.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/any23/extractor/akn/package-info.java b/core/src/main/java/org/apache/any23/extractor/akn/package-info.java new file mode 100644 index 0000000..508ee81 --- /dev/null +++ b/core/src/main/java/org/apache/any23/extractor/akn/package-info.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * <p>This package contains the definition of a specific + * {@link org.apache.any23.extractor.Extractor} for <i>AkomaNtoso</i> + * files.</p> + * <p>Akoma Ntoso is an emerging legal document standard for representing + * legislative and judicial documents in XML format. + * @see http://www.akomtantoso.org + * @see http://code.google.com/p/akomantoso + * @author lewismc + */ +package org.apache.any23.extractor.akn; \ No newline at end of file
