1 /*
2 * ModeShape (http://www.modeshape.org)
3 * See the COPYRIGHT.txt file distributed with this work for information
4 * regarding copyright ownership. Some portions may be licensed
5 * to Red Hat, Inc. under one or more contributor license agreements.
6 * See the AUTHORS.txt file in the distribution for a full listing of
7 * individual contributors.
8 *
9 * ModeShape is free software. Unless otherwise indicated, all code in ModeShape
10 * is licensed to you under the terms of the GNU Lesser General Public License as
11 * published by the Free Software Foundation; either version 2.1 of
12 * the License, or (at your option) any later version.
13 *
14 * ModeShape is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this software; if not, write to the Free
21 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
23 */
24 package org.modeshape.graph.sequencer;
25
26 import org.modeshape.graph.property.Name;
27 import org.modeshape.graph.property.Path;
28
29 /**
30 * Interface for sequencers to use to generate their output.
31 */
32 public interface SequencerOutput {
33
34 /**
35 * Set the supplied property on the supplied node.
36 * <p>
37 * The {@link StreamSequencerContext#getValueFactories() value factories} should be used to create paths, names, and values.
38 * These factories can be used to create new values or convert values from one property type to another. (Note that each of
39 * the factories have methods that create values from all of the property types.)
40 * </p>
41 * <p>
42 * This method is provided as a convenience, but it identical to creating a {@link Path} and {@link Name} using the
43 * {@link StreamSequencerContext#getValueFactories() factories} and calling {@link #setProperty(Path, Name, Object...)}.
44 * </p>
45 *
46 * @param nodePath the path to the node containing the property; may not be null
47 * @param propertyName the name of the property to be set
48 * @param values the value(s) for the property; may be empty if any existing property is to be removed
49 */
50 void setProperty( String nodePath,
51 String propertyName,
52 Object... values );
53
54 /**
55 * Set the supplied reference on the supplied node.
56 * <p>
57 * This method is provided as a convenience, but it identical to creating a {@link Path} and {@link Name} using the
58 * {@link StreamSequencerContext#getValueFactories() factories} and calling {@link #setProperty(Path, Name, Object...)}.
59 * </p>
60 *
61 * @param nodePath the path to the node containing the property; may not be null
62 * @param propertyName the name of the property to be set
63 * @param paths the paths to the referenced property, which may be absolute paths or relative to the sequencer output node;
64 * may be empty if any existing property is to be removed
65 */
66 void setReference( String nodePath,
67 String propertyName,
68 String... paths );
69
70 /**
71 * Set the supplied property on the supplied node.
72 * <p>
73 * The {@link StreamSequencerContext#getValueFactories() value factories} should be used to create paths, names, and values.
74 * These factories can be used to create new values or convert values from one property type to another. (Note that each of
75 * the factories have methods that create values from all of the property types.)
76 * </p>
77 *
78 * @param nodePath the path to the node containing the property; may not be null
79 * @param propertyName the name of the property to be set
80 * @param values the value(s) for the property; may be empty if any existing property is to be removed
81 */
82 void setProperty( Path nodePath,
83 Name propertyName,
84 Object... values );
85 }