/*
* #%L
* BroadleafCommerce Open Admin Platform
* %%
* Copyright (C) 2009 - 2013 Broadleaf Commerce
* %%
* 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.
* #L%
*/
package org.broadleafcommerce.openadmin.dto;
import org.broadleafcommerce.common.util.BLCMapUtils;
import org.broadleafcommerce.common.util.TypedClosure;
import java.io.Serializable;
import java.util.Map;
/**
*
* @author jfischer
*
*/
public class ClassMetadata implements Serializable {
private static final long serialVersionUID = 1L;
private String ceilingType;
private String securityCeilingType;
private ClassTree polymorphicEntities;
private Property[] properties;
private String currencyCode = "USD";
private Map<String, Property> pMap = null;
public Map<String, Property> getPMap() {
if (pMap == null) {
pMap = BLCMapUtils.keyedMap(properties, new TypedClosure<String, Property>() {
@Override
public String getKey(Property value) {
return value.getName();
}
});
}
return pMap;
}
public String getCeilingType() {
return ceilingType;
}
public void setCeilingType(String type) {
this.ceilingType = type;
}
/**
* For dynamic forms, the type to check security permissions will be different than the type used to generate the
* forms. For example, a user with "ADD" or "UPDATE" permissions on STRUCTURE_CONTENT does not need
* to have the same level of access to StructuredContentTemplate.
*
* @param type
*/
public String getSecurityCeilingType() {
return securityCeilingType;
}
public void setSecurityCeilingType(String securityCeilingType) {
this.securityCeilingType = securityCeilingType;
}
public ClassTree getPolymorphicEntities() {
return polymorphicEntities;
}
public void setPolymorphicEntities(ClassTree polymorphicEntities) {
this.polymorphicEntities = polymorphicEntities;
}
public Property[] getProperties() {
return properties;
}
public void setProperties(Property[] property) {
this.properties = property;
}
public String getCurrencyCode() {
return currencyCode;
}
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
}
}