source: java/main/src/main/java/com/framsticks/params/CompositeParam.java @ 193

Last change on this file since 193 was 193, checked in by Maciej Komosinski, 10 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
File size: 924 bytes
Line 
1package com.framsticks.params;
2
3import javax.annotation.concurrent.Immutable;
4
5/**
6 * @author Piotr Sniegowski
7 */
8@Immutable
9public abstract class CompositeParam extends ValueParam {
10
11        protected final String containedTypeName;
12
13        public CompositeParam(ParamBuilder builder) {
14                super(builder);
15                this.containedTypeName = builder.getContainedTypeName();
16        }
17
18        public boolean isMatchingContainedName(String name) {
19                assert name != null;
20                if (containedTypeName == null) {
21                        return true;
22                }
23                return name.equals(containedTypeName);
24        }
25
26        public String getContainedTypeName() {
27                return containedTypeName;
28        }
29
30        public abstract Access prepareAccess(Access access);
31
32        public abstract String computeAccessId();
33
34        public <T> T getDef(Class<T> type) throws ClassCastException {
35                return null;
36        }
37
38        @Override
39        public String toString() {
40                return getId() + ":" + this.getClass().getSimpleName() + "(" + containedTypeName + ")";
41        }
42
43}
Note: See TracBrowser for help on using the repository browser.