public interface EntityMapBuilder
Creating the metadata for clipboard entity using this builder does not create an actual property on the clipboard. The entities created here are just metadata for serialization/deserialization.
Modifier and Type | Method and Description |
---|---|
EntityMap |
buildEntityMapFromModel(java.lang.String aClass,
java.lang.String aModelName,
PublicAPI tools)
Creates and returns an EntityMap based on the specified Rule-Obj-Model.
|
JSONEntity |
createAnonymousJSONEntity(JSONEntity context)
Creates an entity representation for the JSON field.
|
JSONEntity |
createAnonymousJSONEntity(java.lang.String... context)
Creates an anonymous JSON entity like a scalar, object or an array
inside a multidimensional array.
|
ClipboardEntity |
createClipboardEntity(java.lang.String name,
ClipboardEntity context)
Creates an entity representation for the clipboard property.
|
ClipboardEntity |
createClipboardEntity(java.lang.String name,
ClipboardEntity context,
java.lang.String pageClass)
Creates an entity representation for the clipboard property.
|
ClipboardEntity |
createClipboardEntity(java.lang.String name,
java.lang.String... context)
Creates an entity representation for the clipboard property.
|
EntityMap |
createEntityMap(MappingDirection direction)
Creates and returns an empty map for specifying the mapping between the
clipboard and the data stream.
|
JSONEntity |
createJSONEntity(java.lang.String name,
JSONEntity context)
Creates an entity representation for the JSON field.
|
JSONEntity |
createJSONEntity(java.lang.String name,
java.lang.String... context)
Creates an entity representation for the JSON field.
|
JSONEntity createJSONEntity(java.lang.String name, java.lang.String... context)
If the field is on a nested structure then the context will be list of strings starting from the root and then up to the field omitting the root and the field itself.
Consider sample below:
{
"Id" : 1234
"contactInfo" : {
"address" : {
"Street" : "1 Rogers St"
"City" : "Cambridge"
"Zip" : "02148"
}
}
}
To create an entity for JSON field "Street", specify:
"Street" for name
"contactInfo", "address" as the context in that order
To specify the context for anonymous entities (like anonymous arrays, scalar elements) in the context argument use ElementType.CURRENT.toString()
name
- the name of the JSON fieldcontext
- the context in which the JSON entity can be found
when traversing from the root of JSON stream.JSONEntity createJSONEntity(java.lang.String name, JSONEntity context)
createJSONEntity(java.lang.String, java.lang.String...)
to pass in a
previously created parent JSONEntity as the context.name
- the name of the JSON fieldcontext
- the context in which the JSON entity can be found
when traversing from the root of JSON stream.JSONEntity createAnonymousJSONEntity(java.lang.String... context)
To specify the context for anonymous entities (like anonymous arrays, scalar elements) in the context argument use ElementType.CURRENT.toString()
context
- the context in which the JSON entity can be found
when traversing from the root of JSON stream.JSONEntity createAnonymousJSONEntity(JSONEntity context)
createAnonymousJSONEntity(java.lang.String...)
to pass in a
previously created parent JSONEntity as the context.context
- the context in which the JSON entity can be found
when traversing from the root of JSON stream.ClipboardEntity createClipboardEntity(java.lang.String name, java.lang.String... context)
If the field is on a nested structure then the context will be list of strings starting from the primary page (page being serialized/deserialized) and then up to the property omitting the primary page and the property itself.
For sample, refer to the createJSONEntity(java.lang.String, java.lang.String...)
(JSONEntity) javadoc.
When specifying the context the context should be relative to the page/property being
serialized or deserialized. Consider sample clipboard structure below:
myPage
- <id>1234</id>
- <contactInfo>
-<address>
- <Street>1 Rogers St</Street>
- <City>Cambridge</City>
- <Zip>02148</Zip>
</address>
</contactInfo>
If myPage is being serialized/deserialized, the context for each element looks like below:
id - null, it is not necessary to set context for elements on the top page/property being serialized
contactInfo - null, same as above
address - [contactInfo]
Street - [contactInfo, address] in that order
City - [contactInfo, address] in that order
Zip - [contactInfo, address] in that order
If contactInfo is being serialized/deserialized, the context for each element looks like below:
address - null, it is not necessary to set context for elements on the top page/property being serialized
Street - [address]
City - [address]
Zip - [address]
If a page list is being serialized/deserialized the same rules apply except that the page that holds a page list is not explictly mentioned in the context. It is understood that if the page list contains another page list then the context is simply specified as [outerPageListName, innerPageListName] in that order.
name
- name the name of the clipboard propertycontext
- the context in which the clipboard property is found on the
page/property used for deserialization/serializationClipboardEntity createClipboardEntity(java.lang.String name, ClipboardEntity context)
createClipboardEntity(java.lang.String, java.lang.String...)
to pass in a
previously created parent ClipboardEntity as the context.name
- name of the clipboard propertycontext
- the context in which the clipboard property is found on the
page/property used for deserialization/serializationClipboardEntity createClipboardEntity(java.lang.String name, ClipboardEntity context, java.lang.String pageClass)
createClipboardEntity(java.lang.String, java.lang.String...)
to pass in a
previously created parent ClipboardEntity as the context.name
- name of the clipboard propertycontext
- the context in which the clipboard property is found on the
page/property used for deserialization/serializationpageClass
- optional, class to be used when creating a page for this property,
should be set only for entities of type Page/Page ListEntityMap createEntityMap(MappingDirection direction)
direction
- EntityMap buildEntityMapFromModel(java.lang.String aClass, java.lang.String aModelName, PublicAPI tools) throws PRRuntimeException
aClass
- Applies To class of the modelaModelName
- Name of the modeltools
- Handle to the runtime PublicAPIPRRuntimeException
Copyright © 2018 Pegasystems Inc. All Rights Reserved.