Class JSFactory


  • public class JSFactory
    extends Object
    User: mike Date: 10/24/19 Time: 10:51
    • Constructor Detail

      • JSFactory

        public JSFactory()
    • Method Detail

      • getFactory

        public static JSFactory getFactory()
      • 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 path
        nd - - 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 property
        value - String
        Returns:
        the property
      • makeProperty

        public JSProperty<?> makeProperty​(String propertyName,
                                          JSUnsignedInteger value)
        Create an UnsignedInteger property
        Parameters:
        propertyName - of property
        value - UnsignedInteger
        Returns:
        the property
      • makeProperty

        public JSProperty<?> makeProperty​(String propertyName,
                                          Integer value)
        Create an Integer property
        Parameters:
        propertyName - of property
        value - Integer
        Returns:
        the property
      • makeProperty

        public JSProperty<?> makeProperty​(String propertyName,
                                          boolean value)
        Create a boolean property
        Parameters:
        propertyName - of property
        value - true/false
        Returns:
        the property
      • 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 JSValueJSProperty<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 property
        type - the type the value it needs to be
        nd - the node with the value
        Returns:
        a new property
      • newValue

        public JSValue newValue​(String type,
                                com.fasterxml.jackson.databind.JsonNode node)
      • getType

        public String getType​(com.fasterxml.jackson.databind.JsonNode nd)