foundation.icon.ee.struct.ClassPropertyMemberInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javaee-rt Show documentation
Show all versions of javaee-rt Show documentation
An Execution Environment for Java SCOREs
/*
* Copyright 2020 ICON Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package foundation.icon.ee.struct;
import foundation.icon.ee.util.ASM;
import org.objectweb.asm.Type;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ClassPropertyMemberInfo {
private final Type type;
private final Type superType;
private final boolean isCreatable;
private final List fields;
private final List getters;
private final List setters;
public ClassPropertyMemberInfo(Type type, Type superType, boolean isCreatable,
List fields, List getters,
List setters) {
this.type = type;
this.superType = superType;
this.isCreatable = isCreatable;
this.fields = fields;
this.getters = getters;
this.setters = setters;
}
public Type getType() {
return type;
}
public Type getSuperType() {
return superType;
}
public boolean isCreatable() {
return isCreatable;
}
public List getFields() {
return fields;
}
public List getGetters() {
return getters;
}
public List getSetters() {
return setters;
}
public static ClassPropertyMemberInfo fromBytes(byte[] classBytes) {
return ASM.accept(classBytes, new ClassPropertyMemberInfoCollector())
.getClassPropertyInfo();
}
public static Map map(
Map classMap) {
var cpiMap = new HashMap();
for (var e : classMap.entrySet()) {
var cpi = ClassPropertyMemberInfo.fromBytes(e.getValue());
cpiMap.put(cpi.getType(), cpi);
}
return cpiMap;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy