MetaComponent.java
01 /*
02  * SPDX-License-Identifier: Apache-2.0
03  *
04  * Copyright 2008-2017 the original author or authors.
05  *
06  * Licensed under the Apache License, Version 2.0 (the "License");
07  * you may not use this file except in compliance with the License.
08  * You may obtain a copy of the License at
09  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 package griffon.javafx.support;
19 
20 import javafx.beans.DefaultProperty;
21 
22 import javax.annotation.Nonnull;
23 import java.util.ArrayList;
24 import java.util.List;
25 
26 import static griffon.util.GriffonNameUtils.requireNonBlank;
27 
28 /**
29  @author Andres Almiray
30  @since 2.12.0
31  */
32 @DefaultProperty("mvcArgs")
33 public class MetaComponent {
34     private String mvcType;
35     private String mcvId;
36     private final List<MvcArg> mvcArgs = new ArrayList<>();
37 
38     public String getMvcType() {
39         return mvcType;
40     }
41 
42     public void setMvcType(String mvcType) {
43         this.mvcType = mvcType;
44     }
45 
46     public String getMcvId() {
47         return mcvId;
48     }
49 
50     public void setMcvId(String mcvId) {
51         this.mcvId = mcvId;
52     }
53 
54     @Nonnull
55     public List<MvcArg> getMvcArgs() {
56         return mvcArgs;
57     }
58 
59     public static class MvcArg {
60         private String name;
61         private String value;
62 
63         public String getName() {
64             return name;
65         }
66 
67         public void setName(@Nonnull String name) {
68             this.name = requireNonBlank(name, "Argument 'name' must not be blank");
69         }
70 
71         public String getValue() {
72             return value;
73         }
74 
75         public void setValue(String value) {
76             this.value = value;
77         }
78     }
79 }