Class SourceFactoryUtilities


  • public class SourceFactoryUtilities
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.sun.codemodel.JVar addListParameter​(com.sun.codemodel.JMethod method, com.sun.codemodel.JFieldVar field, boolean isClearEnabled, IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException>... procedure)  
      static com.sun.codemodel.JVar addMapParameter​(com.sun.codemodel.JMethod method, com.sun.codemodel.JFieldVar field, com.sun.codemodel.JType nameType, java.lang.String nameVariableName, com.sun.codemodel.JType valueType, java.lang.String valueVariableName, IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException>... procedure)  
      static com.sun.codemodel.JVar addObjectParameter​(com.sun.codemodel.JMethod method, com.sun.codemodel.JFieldVar field, IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException>... procedure)  
      static com.sun.codemodel.JVar addParameter​(com.sun.codemodel.JMethod method, com.sun.codemodel.JFieldVar field)  
      static void adjust​(com.sun.codemodel.JCodeModel codeModel, com.sun.codemodel.JFieldVar field, java.lang.Object value, boolean isArrayNullable)  
      static <C> void adjust​(com.sun.codemodel.JCodeModel codeModel, com.sun.codemodel.JFieldVar field, java.lang.Object value, boolean isArrayNullable, SourceFactoryUtilities.ValueConverter valueConverter, java.lang.String className, java.lang.Class<C[]> clazz)  
      static IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException> createAddIfNullClearListAndReturnClosure​(com.sun.codemodel.JMethod method, com.sun.codemodel.JExpression returnValue)  
      static IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException> createAddIfNullClearMapAndReturnClosure​(com.sun.codemodel.JMethod method, com.sun.codemodel.JExpression returnValue)  
      static IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException> createAddIfNullReturnClosure​(com.sun.codemodel.JMethod method, com.sun.codemodel.JExpression returnValue)  
      static IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException> createAddIfNullReturnNullClosure​(com.sun.codemodel.JMethod method)  
      static IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException> createAddIfNullSetEmptyArrayAndReturnClosure​(com.sun.codemodel.JCodeModel codeModel, com.sun.codemodel.JMethod method, com.sun.codemodel.JExpression returnValue)  
      static IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException> createEnsureArgumentNotNullClosure​(EnsurePredicateFactory ensurePredicateFactory, com.sun.codemodel.JMethod method, IAcceptor<com.sun.codemodel.JVar>... acceptors)  
      static java.lang.String createFieldName​(java.lang.String name)  
      static boolean isInstanceOfList​(com.sun.codemodel.JType type)  
      static boolean isInstanceOfMap​(com.sun.codemodel.JType jclazz)  
      static com.sun.codemodel.JVar setMapParameters​(com.sun.codemodel.JMethod method, com.sun.codemodel.JFieldVar field, boolean isClearEnabled, IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException>... procedure)  
      static java.lang.String withoutGenerics​(java.lang.String name)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SourceFactoryUtilities

        public SourceFactoryUtilities()
    • Method Detail

      • createFieldName

        public static java.lang.String createFieldName​(java.lang.String name)
      • addObjectParameter

        @SafeVarargs
        public static com.sun.codemodel.JVar addObjectParameter​(com.sun.codemodel.JMethod method,
                                                                com.sun.codemodel.JFieldVar field,
                                                                IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException>... procedure)
      • addMapParameter

        @SafeVarargs
        public static com.sun.codemodel.JVar addMapParameter​(com.sun.codemodel.JMethod method,
                                                             com.sun.codemodel.JFieldVar field,
                                                             com.sun.codemodel.JType nameType,
                                                             java.lang.String nameVariableName,
                                                             com.sun.codemodel.JType valueType,
                                                             java.lang.String valueVariableName,
                                                             IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException>... procedure)
      • setMapParameters

        @SafeVarargs
        public static com.sun.codemodel.JVar setMapParameters​(com.sun.codemodel.JMethod method,
                                                              com.sun.codemodel.JFieldVar field,
                                                              boolean isClearEnabled,
                                                              IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException>... procedure)
      • addParameter

        public static com.sun.codemodel.JVar addParameter​(com.sun.codemodel.JMethod method,
                                                          com.sun.codemodel.JFieldVar field)
      • addListParameter

        @SafeVarargs
        public static com.sun.codemodel.JVar addListParameter​(com.sun.codemodel.JMethod method,
                                                              com.sun.codemodel.JFieldVar field,
                                                              boolean isClearEnabled,
                                                              IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException>... procedure)
      • createAddIfNullReturnNullClosure

        public static IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException> createAddIfNullReturnNullClosure​(com.sun.codemodel.JMethod method)
      • createAddIfNullSetEmptyArrayAndReturnClosure

        public static IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException> createAddIfNullSetEmptyArrayAndReturnClosure​(com.sun.codemodel.JCodeModel codeModel,
                                                                                                                                       com.sun.codemodel.JMethod method,
                                                                                                                                       com.sun.codemodel.JExpression returnValue)
      • createAddIfNullClearMapAndReturnClosure

        public static IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException> createAddIfNullClearMapAndReturnClosure​(com.sun.codemodel.JMethod method,
                                                                                                                                  com.sun.codemodel.JExpression returnValue)
      • createAddIfNullClearListAndReturnClosure

        public static IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException> createAddIfNullClearListAndReturnClosure​(com.sun.codemodel.JMethod method,
                                                                                                                                   com.sun.codemodel.JExpression returnValue)
      • createAddIfNullReturnClosure

        public static IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException> createAddIfNullReturnClosure​(com.sun.codemodel.JMethod method,
                                                                                                                       com.sun.codemodel.JExpression returnValue)
      • createEnsureArgumentNotNullClosure

        @SafeVarargs
        public static IProcedure<com.sun.codemodel.JVar,​java.lang.RuntimeException> createEnsureArgumentNotNullClosure​(EnsurePredicateFactory ensurePredicateFactory,
                                                                                                                             com.sun.codemodel.JMethod method,
                                                                                                                             IAcceptor<com.sun.codemodel.JVar>... acceptors)
      • adjust

        public static void adjust​(com.sun.codemodel.JCodeModel codeModel,
                                  com.sun.codemodel.JFieldVar field,
                                  java.lang.Object value,
                                  boolean isArrayNullable)
      • adjust

        public static <C> void adjust​(com.sun.codemodel.JCodeModel codeModel,
                                      com.sun.codemodel.JFieldVar field,
                                      java.lang.Object value,
                                      boolean isArrayNullable,
                                      SourceFactoryUtilities.ValueConverter valueConverter,
                                      java.lang.String className,
                                      java.lang.Class<C[]> clazz)
      • isInstanceOfList

        public static boolean isInstanceOfList​(com.sun.codemodel.JType type)
      • isInstanceOfMap

        public static boolean isInstanceOfMap​(com.sun.codemodel.JType jclazz)
      • withoutGenerics

        public static java.lang.String withoutGenerics​(java.lang.String name)