Search in sources :

Example 16 with GenericProperty

use of org.structr.core.property.GenericProperty in project structr by structr.

the class JarConfigurationProvider method getPropertyKeyForJSONName.

@Override
public PropertyKey getPropertyKeyForJSONName(Class type, String jsonName, boolean createIfNotFound) {
    if (jsonName == null) {
        return null;
    }
    Map<String, PropertyKey> classJSNamePropertyMap = getClassJSNamePropertyMapForType(type);
    PropertyKey key = classJSNamePropertyMap.get(jsonName);
    if (key == null) {
        // first try: uuid
        if (GraphObject.id.dbName().equals(jsonName)) {
            return GraphObject.id;
        }
        if (createIfNotFound) {
            key = new GenericProperty(jsonName);
        }
    }
    return key;
}
Also used : GenericProperty(org.structr.core.property.GenericProperty) PropertyKey(org.structr.core.property.PropertyKey)

Aggregations

GenericProperty (org.structr.core.property.GenericProperty)16 GraphObjectMap (org.structr.core.GraphObjectMap)12 LinkedList (java.util.LinkedList)9 GraphObject (org.structr.core.GraphObject)8 PropertyKey (org.structr.core.property.PropertyKey)7 List (java.util.List)5 Map (java.util.Map)5 HashMap (java.util.HashMap)4 FrameworkException (org.structr.common.error.FrameworkException)4 Result (org.structr.core.Result)4 NodeInterface (org.structr.core.graph.NodeInterface)4 Tx (org.structr.core.graph.Tx)4 RestMethodResult (org.structr.rest.RestMethodResult)4 LinkedHashMap (java.util.LinkedHashMap)3 LinkedHashSet (java.util.LinkedHashSet)3 TreeMap (java.util.TreeMap)3 Test (org.junit.Test)3 SchemaNode (org.structr.core.entity.SchemaNode)3 SchemaView (org.structr.core.entity.SchemaView)3 TypeInfoFunction (org.structr.core.function.TypeInfoFunction)3