001/*
002 * (C) Copyright 2015 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 *     Thierry Delprat <tdelprat@nuxeo.com>
018 */
019package org.nuxeo.automation.scripting.internals;
020
021import org.nuxeo.common.xmap.annotation.XNode;
022import org.nuxeo.common.xmap.annotation.XNodeList;
023import org.nuxeo.common.xmap.annotation.XObject;
024import org.nuxeo.ecm.automation.OperationDocumentation;
025
026/**
027 * @since 7.2
028 */
029@XObject("scriptedOperation")
030public class ScriptingOperationDescriptor {
031
032    @XNode("@id")
033    protected String id;
034
035    @XNode("inputType")
036    protected String inputType;
037
038    @XNode("outputType")
039    protected String outputType;
040
041    @XNode("description")
042    protected String description;
043
044    @XNode("category")
045    protected String category;
046
047    @XNodeList(value = "aliases/alias", type = String[].class, componentType = String.class)
048    protected String[] aliases;
049
050    @XNodeList(value = "param", type = OperationDocumentation.Param[].class, componentType = OperationDocumentation.Param.class)
051    protected OperationDocumentation.Param[] params = new OperationDocumentation.Param[0];
052
053    @XNode("script")
054    protected String source;
055
056    public String[] getAliases() {
057        return aliases;
058    }
059
060    public String getInputType() {
061        return inputType;
062    }
063
064    public String getOutputType() {
065        return outputType;
066    }
067
068    public String getId() {
069        return id;
070    }
071
072    public String getDescription() {
073        return description;
074    }
075
076    public String getCategory() {
077        return category;
078    }
079
080    public OperationDocumentation.Param[] getParams() {
081        return params;
082    }
083
084}