Package org.bedework.jsforj.impl
Class JSFactory
- java.lang.Object
-
- org.bedework.jsforj.impl.JSFactory
-
public class JSFactory extends Object
User: mike Date: 10/24/19 Time: 10:51
-
-
Constructor Summary
Constructors Constructor Description JSFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JSFactorygetFactory()static StringgetPropertyType(String name)StringgetType(com.fasterxml.jackson.databind.JsonNode nd)static JSTypeInfogetTypeInfo(String name)JSCalendarObjectmakeCalObj(com.fasterxml.jackson.databind.JsonNode nd)Creates objects which may be independent top level objects or entries in a group.JSProperty<?>makeProperty(String propertyName)JSProperty<?>makeProperty(String propertyName, boolean value)Create a boolean propertyJSProperty<?>makeProperty(String propertyName, com.fasterxml.jackson.databind.JsonNode nd)JSProperty<?>makeProperty(String propertyName, com.fasterxml.jackson.databind.JsonNode nd, String providedType)JSProperty<?>makeProperty(String propertyName, Integer value)Create an Integer propertyJSProperty<JSString>makeProperty(String propertyName, String value)Create a string property<ValClass extends JSValue>
JSProperty<ValClass>makeProperty(String propertyName, String type, com.fasterxml.jackson.databind.JsonNode nd)Used for the situations where we have no @type - path objects.JSProperty<?>makeProperty(String propertyName, JSUnsignedInteger value)Create an UnsignedInteger propertyJSProperty<?>makeProperty(String propertyName, JSValue value)JSValuemakePropertyValue(String propertyName, com.fasterxml.jackson.databind.JsonNode nd, String providedType)JSValuemakePropertyValueWithType(String type, com.fasterxml.jackson.databind.JsonNode nd)JSValuenewValue(String type)JSValuenewValue(String type, com.fasterxml.jackson.databind.JsonNode node)static voidregister(JSRegistration val)
-
-
-
Method Detail
-
getFactory
public static JSFactory getFactory()
-
register
public static void register(JSRegistration val)
-
getPropertyType
public static String getPropertyType(String name)
- Parameters:
name- of property- Returns:
- type name - null if unknown property
-
getTypeInfo
public static JSTypeInfo getTypeInfo(String name)
- Parameters:
name- of type- Returns:
- type information - null if unknown type
-
makeCalObj
public JSCalendarObject makeCalObj(com.fasterxml.jackson.databind.JsonNode nd)
Creates objects which may be independent top level objects or entries in a group.- Parameters:
nd-- Returns:
-
makePropertyValue
public JSValue makePropertyValue(String propertyName, com.fasterxml.jackson.databind.JsonNode nd, String providedType)
- Parameters:
propertyName- - may be a pathnd- - representing value- Returns:
- the new value
-
makePropertyValueWithType
public JSValue makePropertyValueWithType(String type, com.fasterxml.jackson.databind.JsonNode nd)
-
makeProperty
public JSProperty<JSString> makeProperty(String propertyName, String value)
Create a string property- Parameters:
propertyName- of propertyvalue- String- Returns:
- the property
-
makeProperty
public JSProperty<?> makeProperty(String propertyName, JSUnsignedInteger value)
Create an UnsignedInteger property- Parameters:
propertyName- of propertyvalue- UnsignedInteger- Returns:
- the property
-
makeProperty
public JSProperty<?> makeProperty(String propertyName, Integer value)
Create an Integer property- Parameters:
propertyName- of propertyvalue- Integer- Returns:
- the property
-
makeProperty
public JSProperty<?> makeProperty(String propertyName, boolean value)
Create a boolean property- Parameters:
propertyName- of propertyvalue- true/false- Returns:
- the property
-
makeProperty
public JSProperty<?> makeProperty(String propertyName)
-
makeProperty
public JSProperty<?> makeProperty(String propertyName, com.fasterxml.jackson.databind.JsonNode nd)
-
makeProperty
public JSProperty<?> makeProperty(String propertyName, com.fasterxml.jackson.databind.JsonNode nd, String providedType)
-
makeProperty
public <ValClass extends JSValue> JSProperty<ValClass> makeProperty(String propertyName, String type, com.fasterxml.jackson.databind.JsonNode nd)
Used for the situations where we have no @type - path objects. These are used for overrides and localizations.- Parameters:
propertyName- the name of the propertytype- the type the value it needs to bend- the node with the value- Returns:
- a new property
-
makeProperty
public JSProperty<?> makeProperty(String propertyName, JSValue value)
-
getType
public String getType(com.fasterxml.jackson.databind.JsonNode nd)
-
-