001/*
002 * Licensed to DuraSpace under one or more contributor license agreements.
003 * See the NOTICE file distributed with this work for additional information
004 * regarding copyright ownership.
005 *
006 * DuraSpace licenses this file to you under the Apache License,
007 * Version 2.0 (the "License"); you may not use this file except in
008 * compliance with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.fcrepo.kernel.modeshape;
019
020import static org.fcrepo.kernel.modeshape.utils.FedoraTypesUtils.isContainer;
021
022import javax.jcr.Node;
023
024import org.fcrepo.kernel.api.models.Container;
025
026/**
027 * An abstraction that represents a Fedora Object backed by
028 * a JCR node.
029 *
030 * @author ajs6f
031 * @since Feb 21, 2013
032 */
033public class ContainerImpl extends FedoraResourceImpl implements Container {
034
035
036    /**
037     * Construct a {@link org.fcrepo.kernel.api.models.Container} from an existing JCR Node
038     * @param node an existing JCR node to treat as an fcrepo object
039     */
040    public ContainerImpl(final Node node) {
041        super(node);
042    }
043
044    /**
045     * Check if the node has a fedora:object mixin
046     * @param node the given node
047     * @return true if the node has the fedora object mixin
048     */
049    public static boolean hasMixin(final Node node) {
050        return isContainer.test(node);
051    }
052
053}