Class ModelASTElement

    • Method Detail

      • getSourceLocation

        public Object getSourceLocation()
      • setSourceLocation

        public void setSourceLocation​(Object sourceLocation)
      • toJSON

        @NonNull
        public abstract Object toJSON()
        Translates this element and any children it may have into JSON conforming to the schema.
        Specified by:
        toJSON in interface ModelASTMarkerInterface
        Returns:
        Generally a JSONObject or JSONArray but for some leaf nodes, may be a String or other simple class.
      • nullIfEmpty

        @CheckForNull
        protected static <T extends Collection> T nullIfEmpty​(@CheckForNull
                                                              T list)
      • toGroovy

        @NonNull
        public abstract String toGroovy()
        Translates this element and any children it may have into Pipeline Config-formatted Groovy, without any indentations.
        Specified by:
        toGroovy in interface ModelASTMarkerInterface
        Returns:
        A simple String of Groovy code for this element and its children.
      • toGroovy

        @NonNull
        protected static String toGroovy​(@CheckForNull
                                         ModelASTMarkerInterface item)
        Translates this element and any children it may have into Pipeline Config-formatted Groovy, without any indentations.
        Returns:
        A simple String of Groovy code for this element and its children.
      • toGroovyCheckEmpty

        @NonNull
        protected static String toGroovyCheckEmpty​(@CheckForNull
                                                   ModelASTElementContainer item)
        Translates this element and any children it may have into Pipeline Config-formatted Groovy, without any indentations.
        Returns:
        A simple String of Groovy code for this element and its children.
      • toGroovy

        @NonNull
        protected static <T extends ModelASTMarkerInterfaceString toGroovy​(List<T> list)
        Translates this element and any children it may have into Pipeline Config-formatted Groovy, without any indentations.
        Returns:
        A simple String of Groovy code for this element and its children.
      • toGroovyArgList

        @NonNull
        protected static <T extends ModelASTMarkerInterfaceString toGroovyArgList​(Collection<T> list)
        Translates this element and any children it may have into Pipeline Config-formatted Groovy, without any indentations.
        Returns:
        A simple String of Groovy code for this element and its children.
      • toGroovyArgList

        @NonNull
        protected static <K extends ModelASTMarkerInterface,​V extends ModelASTMarkerInterfaceString toGroovyArgList​(Map<K,​V> map,
                                                                                                                            String separator)
        Translates this element and any children it may have into Pipeline Config-formatted Groovy, without any indentations.
        Returns:
        A simple String of Groovy code for this element and its children.
      • toGroovyBlock

        @NonNull
        protected static String toGroovyBlock​(String name,
                                              ModelASTMarkerInterface item)
        Translates this element and any children it may have into Pipeline Config-formatted Groovy, without any indentations.
        Returns:
        A simple String of Groovy code for this element and its children.
      • toGroovyBlock

        @NonNull
        protected static <T extends ModelASTMarkerInterfaceString toGroovyBlock​(String name,
                                                                                  List<T> list)
        Translates this element and any children it may have into Pipeline Config-formatted Groovy, without any indentations.
        Returns:
        A simple String of Groovy code for this element and its children.
      • toGroovyBlock

        @NonNull
        protected static <K extends ModelASTMarkerInterface,​V extends ModelASTMarkerInterfaceString toGroovyBlock​(String name,
                                                                                                                          Map<K,​V> map,
                                                                                                                          String separator)
        Translates this element and any children it may have into Pipeline Config-formatted Groovy, without any indentations.
        Returns:
        A simple String of Groovy code for this element and its children.
      • validate

        public void validate​(@NonNull
                             ModelValidator validator)
        Called to do whatever validation is necessary for this element. Overridden in most cases.
        Specified by:
        validate in interface ModelASTMarkerInterface
        Parameters:
        validator - A ModelValidator to use for more complicated validation.
      • removeSourceLocationsFrom

        protected static void removeSourceLocationsFrom​(@CheckForNull
                                                        ModelASTMarkerInterface... items)
        Removes the source location value from this list of elements element.
      • removeSourceLocationsFrom

        protected static <T extends ModelASTMarkerInterface> void removeSourceLocationsFrom​(@CheckForNull
                                                                                            Collection<T> list)
        Removes the source location value from this list of elements.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object