"""
variable :: String -> <ReadGraph> Variable
+ @JavaName getPossibleVariable
+ possibleResourceVariable :: Resource -> <ReadGraph> Maybe Variable
+
@JavaName getPossibleVariable
possibleVariable :: String -> <ReadGraph> Maybe Variable
importJava "org.simantics.db.layer0.variable.VariableMap" where
data VariableMap
+importJava "org.simantics.db.layer0.variable.StructuredProperty" where
+ data StructuredProperty
+
importJava "org.simantics.db.layer0.variable.ResourceCollectionVariableMap" where
@JavaName "<init>"
createVariableMap :: [Resource] -> VariableMap
instance Browsable Variable where
fromUri = variable
uriOf = uri
+ possibleUriOf v = Just (uri v)
nameOf = name
possibleNameOf v = Just (name v)
children v = collectionToList (children_ v)
variantValueOf v = createVariant (datatype v) (untypedValue v :: Dynamic)
child = child_
possibleChild = possibleChild_
+
+ genericRelatedValue v rel = untypedPropertyValue v (nameOf rel)
+ genericPossibleRelatedValue v rel = untypedPossiblePropertyValue v (nameOf rel)
propertiesClassified :: Variable -> Resource -> <ReadGraph> [Variable]
propertiesClassified parent classified = do
instantiateUnder :: Resource -> Resource -> <WriteGraph> Resource
instantiateUnder container typeToInstantiate = do
fn = (resourceVariable typeToInstantiate)#methods#instantiateUnder :: Resource -> Resource -> <WriteGraph> Resource
- fn container typeToInstantiate
\ No newline at end of file
+ fn container typeToInstantiate
+
+@JavaType "org.simantics.db.layer0.variable.VariableOrResource"
+data VariableOrResource =
+ @JavaType "org.simantics.db.layer0.variable.ResourceX"
+ @FieldNames [value]
+ ResourceX Resource
+ | @JavaType "org.simantics.db.layer0.variable.VariableX"
+ @FieldNames [value]
+ VariableX Variable
+
+
\ No newline at end of file