Skip to content

Commit

Permalink
Adding skeletal JavaDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
ajs6f committed Oct 29, 2013
1 parent 42204ac commit e5ee3b6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
Expand Up @@ -39,6 +39,11 @@
import static org.fcrepo.kernel.utils.JcrRdfTools.getRDFNamespaceForJcrNamespace;
import static org.slf4j.LoggerFactory.getLogger;

/**
* @author cbeer
* @date Oct 2013
* @param <T>
*/
public class ItemDefinitionToTriples<T extends ItemDefinition> implements Function<T, Iterator<Triple>> {

private static Logger LOGGER = getLogger(ItemDefinitionToTriples.class);
Expand All @@ -55,7 +60,7 @@ public ItemDefinitionToTriples(final Node domain) {
}

@Override
public Iterator<Triple> apply(T input) {
public Iterator<Triple> apply(final T input) {

final ImmutableCollection.Builder<Triple> nsTriples =
ImmutableSet.builder();
Expand All @@ -70,7 +75,7 @@ public Iterator<Triple> apply(T input) {
nsTriples.add(create(propertyDefinitionNode, RDFS.domain.asNode(), domain));
nsTriples.add(create(propertyDefinitionNode, RDFS.label.asNode(), createLiteral(input.getName())));

} catch (RepositoryException e) {
} catch (final RepositoryException e) {
throw propagate(e);
}

Expand All @@ -84,15 +89,15 @@ public Iterator<Triple> apply(T input) {
* @return
* @throws javax.jcr.RepositoryException
*/
protected Resource getResource(Namespaced namespacedObject) throws RepositoryException {
protected Resource getResource(final Namespaced namespacedObject) throws RepositoryException {
return ResourceFactory.createProperty(getRDFNamespaceForJcrNamespace(namespacedObject.getNamespaceURI()), namespacedObject.getLocalName()).asResource();
}

protected Resource getResource(NodeType nodeType) throws RepositoryException {
protected Resource getResource(final NodeType nodeType) throws RepositoryException {
return getResource((Namespaced) nodeType);
}

protected Resource getResource(ItemDefinition nodeType) throws RepositoryException {
protected Resource getResource(final ItemDefinition nodeType) throws RepositoryException {
return getResource((Namespaced) nodeType);
}
}
Expand Up @@ -33,19 +33,23 @@
import static com.hp.hpl.jena.graph.NodeFactory.createURI;
import static com.hp.hpl.jena.graph.Triple.create;

/**
* @author cbeer
* @date Oct 2013
*/
public class NodeDefinitionToTriples extends ItemDefinitionToTriples<NodeDefinition> {

/**
* Translate ItemDefinitions into triples. The definitions will hang off
* the provided RDF Node
* @param domain
*/
public NodeDefinitionToTriples(Node domain) {
public NodeDefinitionToTriples(final Node domain) {
super(domain);
}

@Override
public Iterator<Triple> apply(NodeDefinition input) {
public Iterator<Triple> apply(final NodeDefinition input) {
final Iterator<Triple> itemDefinition = super.apply(input);

final ImmutableCollection.Builder<Triple> nsTriples =
Expand All @@ -65,7 +69,7 @@ public Iterator<Triple> apply(NodeDefinition input) {
nsTriples.add(create(propertyDefinitionNode, RDFS.range.asNode(), getResource(requiredPrimaryTypes[0]).asNode()));
}

} catch (RepositoryException e) {
} catch (final RepositoryException e) {
throw propagate(e);
}

Expand Down
Expand Up @@ -45,6 +45,10 @@
import static javax.jcr.PropertyType.URI;
import static javax.jcr.PropertyType.WEAKREFERENCE;

/**
* @author cbeer
* @date Oct 2013
*/
public class PropertyDefinitionToTriples extends ItemDefinitionToTriples<PropertyDefinition> {

static final Map<Integer, XSDDatatype> JCR_TYPE_TO_XSD_DATATYPE =
Expand All @@ -66,12 +70,12 @@ public class PropertyDefinitionToTriples extends ItemDefinitionToTriples<Propert
* the provided RDF Node
* @param domain
*/
public PropertyDefinitionToTriples(Node domain) {
public PropertyDefinitionToTriples(final Node domain) {
super(domain);
}

@Override
public Iterator<Triple> apply(PropertyDefinition input) {
public Iterator<Triple> apply(final PropertyDefinition input) {
final Iterator<Triple> itemDefinition = super.apply(input);

final ImmutableCollection.Builder<Triple> nsTriples =
Expand All @@ -84,7 +88,7 @@ public Iterator<Triple> apply(PropertyDefinition input) {
if (rangeForJcrType != null) {
nsTriples.add(create(getResource(input).asNode(), RDFS.range.asNode(), rangeForJcrType));
}
} catch (RepositoryException e) {
} catch (final RepositoryException e) {
throw propagate(e);
}

Expand Down
Expand Up @@ -21,6 +21,10 @@
import javax.jcr.nodetype.NodeType;
import java.util.Iterator;

/**
* @author cbeer
* @date Oct 2013
*/
public class NodeTypeIterator extends ForwardingIterator<NodeType> implements
Iterable<NodeType> {

Expand Down

0 comments on commit e5ee3b6

Please sign in to comment.