001/*
002 * (C) Copyright 2006-2007 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     <a href="mailto:at@nuxeo.com">Anahide Tchertchian</a>
018 *
019 * $Id: FieldDefinition.java 26053 2007-10-16 01:45:43Z atchertchian $
020 */
021
022package org.nuxeo.ecm.platform.forms.layout.api;
023
024import java.io.Serializable;
025
026/**
027 * Interface for field definition.
028 * <p>
029 * Will help to identify a document field.
030 *
031 * @author <a href="mailto:at@nuxeo.com">Anahide Tchertchian</a>
032 */
033public interface FieldDefinition extends Serializable {
034
035    /**
036     * Optional schema name.
037     * <p>
038     * If the field is used to identify a sub field within a complex type, no schema name is needed. Otherwise, the
039     * field will not be resolved correctly if the property does not have a prefix.
040     */
041    String getSchemaName();
042
043    /**
044     * Returns the field name, following XPath conventions.
045     * <p>
046     * If the field is prefixed, it should contain the prefix followed by ':'. Examples: dc:title, dc:author/name
047     */
048    String getFieldName();
049
050    /**
051     * Returns the computed property name with schema and field information.
052     */
053    String getPropertyName();
054
055    /**
056     * Returns a clone instance of this field definition.
057     * <p>
058     * Useful for conversion of layout definition during export.
059     *
060     * @since 5.5
061     */
062    FieldDefinition clone();
063
064}