Start generating a new 'Mail' object to display a new
dialog.

@param ctx       the application context
@return          the Delivery Builder
163389
public static Delivery.Builder newMail(@NotNull Context ctx){
        // Create a new builder
        Delivery.Builder builder = new Delivery.Builder(ctx);

        // Apply defaults if possible
        applyDefaults(builder);

        // Return it
        return builder;
    }
358878
public FbBotMillResponse build(MessageEnvelope envelope) {
		User recipient = getRecipient(envelope);
		Message message = new AttachmentMessage(attachment);
		message.setQuickReplies(quickReplies);
		return new FbBotMillMessageResponse(recipient, message);
	}
13386
public static Message buildDelivered(Zxid deliveredZxid) {
    ZabMessage.Zxid zxid = toProtoZxid(deliveredZxid);
    ZabMessage.Delivered delivered =
      ZabMessage.Delivered.newBuilder().setZxid(zxid).build();
    return Message.newBuilder().setType(MessageType.DELIVERED)
                               .setDelivered(delivered).build();
  }
586081
public BaseMessage createReplyMessage(BaseMessage messageIn)
    {
        //ProductRequest productRequest = (ProductRequest)messageIn.getMessageDataDesc(null);
        BaseMessage replyMessage = (BaseMessage)this.getMessageProcessInfo().createReplyMessage(messageIn);
        
        //BaseProductResponse responseMessage = (BaseProductResponse)replyMessage.getMessageDataDesc(null);
        //responseMessage.moveRequestInfoToReply(productRequest);
        if (replyMessage == null)
            replyMessage = new TreeMessage(null, null);
        if (replyMessage.getExternalMessage() == null)
            new ExternalMapTrxMessageIn(replyMessage, null);
        return replyMessage;    // Override this!
    }
224473
void callXcodeBuild(XCodeContext ctx) throws IOException,
        XCodeException
  {
    final CommandLineBuilder commandLineBuilder = new CommandLineBuilder(ctx);

    //
    //TODO The command line printed into the log is not 100% accurate. We have a problem with
    // quotation marks.
    LOGGER.info("Executing xcode command: '" + commandLineBuilder.toString() + "'.");

    final int returnValue = Forker.forkProcess(ctx.getOut(), ctx.getProjectRootDirectory(),
          commandLineBuilder.createBuildCall());
    if (returnValue != 0) {
      throw new XCodeException("Could not execute xcodebuild for configuration "
            + ctx.getOptions().getAllOptions().get(Options.ManagedOption.CONFIGURATION.getOptionName()));
    }
  }
411637
protected GenericApplicationContext createApplicationContext(ApplicationContext parentCtx) {
        if (parentCtx != null && beanFactory != null) {
            Assert.isInstanceOf(DefaultListableBeanFactory.class, beanFactory,
                    "ListableBeanFactory set must be a subclass of DefaultListableBeanFactory");

            return new GrailsApplicationContext((DefaultListableBeanFactory) beanFactory,parentCtx);
        }

        if (beanFactory != null) {
            Assert.isInstanceOf(DefaultListableBeanFactory.class, beanFactory,
                    "ListableBeanFactory set must be a subclass of DefaultListableBeanFactory");

            return new GrailsApplicationContext((DefaultListableBeanFactory) beanFactory);
        }

        if (parentCtx != null) {
            return new GrailsApplicationContext(parentCtx);
        }

        return new GrailsApplicationContext();
    }
718510
public MAP inboundMap(Map<String, Object> ctx)
   {
      AddressingProperties implementation = (AddressingProperties)ctx.get(CXFMAPConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
      return newMap(implementation);
   }
1198120
@NonNull
    public EmailIntentBuilder cc(@NonNull String cc) {
        checkEmail(cc);
        this.cc.add(cc);
        return this;
    }
839034
public static Object createProxyBean(Class<?> clazz, BeanBox box, BeanBoxContext ctx) {
		BeanBoxException.assureNotNull(clazz, "Try to create a proxy bean, but beanClass not found.");
		Enhancer enhancer = new Enhancer();
		enhancer.setSuperclass(clazz);
		if (box.getConstructorParams() != null && box.getConstructorParams().length > 0) {
			BeanBox[] boxes = box.getConstructorParams();
			Class<?>[] argsTypes = new Class<?>[boxes.length];
			Object[] realArgsValue = new Object[boxes.length];
			for (int i = 0; i < boxes.length; i++) {
				argsTypes[i] = boxes[i].getType();
				Object realValue = ctx.getBean(boxes[i]);
				if (realValue != null && realValue instanceof String)
					realValue = ctx.getValueTranslator().translate((String) realValue, boxes[i].getType());
				realArgsValue[i] = realValue;
			}
			enhancer.setCallback(new ProxyBean(box, ctx));
			return enhancer.create(argsTypes, realArgsValue);
		} else {
			enhancer.setCallback(new ProxyBean(box, ctx));
			return enhancer.create();
		}
	}
900413
public ContextualReference<T> create(CreationalContext<T> ctx) {
        if (this.instance != null) {
            throw new IllegalStateException("Trying to call create() on already constructed instance");
        }
        if (disposed) {
            throw new IllegalStateException("Trying to call create() on an already disposed instance");
        }
        this.instance = bean.create(ctx);
        return this;
    }
458194
public ModelNode buildExecutableRequest(CommandContext ctx) throws Exception {
        try {
            for (FailureDescProvider h : providers) {
                effectiveProviders.add(h);
            }
            // In case some key-store needs to be persisted
            for (String ks : ksToStore) {
                composite.get(Util.STEPS).add(ElytronUtil.storeKeyStore(ctx, ks));
                effectiveProviders.add(new FailureDescProvider() {
                    @Override
                    public String stepFailedDescription() {
                        return "Storing the key-store " + ksToStore;
                    }
                });
            }
            // Final steps
            for (int i = 0; i < finalSteps.size(); i++) {
                composite.get(Util.STEPS).add(finalSteps.get(i));
                effectiveProviders.add(finalProviders.get(i));
            }
            return composite;
        } catch (Exception ex) {
            try {
                failureOccured(ctx, null);
            } catch (Exception ex2) {
                ex.addSuppressed(ex2);
            }
            throw ex;
        }
    }
946666
public MailBuilder from(String name, String email) {
        return param("from", email(name, email));
    }
765247
public static Builder from(GatewayMessage message) {
    return new Builder().headers(message.headers).data(message.data);
  }
408780
@NonNull
    public EmailIntentBuilder to(@NonNull String to) {
        checkEmail(to);
        this.to.add(to);
        return this;
    }
778621
public static void putAuthenticationResultBuilder(final AuthenticationResultBuilder builder, final RequestContext ctx) {
        ctx.getConversationScope().put(PARAMETER_AUTHENTICATION_RESULT_BUILDER, builder);
    }
327018
@Override
    public void start(BundleContext ctxt)
    {
        InputFactoryProviderImpl inputP = new InputFactoryProviderImpl();
        ctxt.registerService(Stax2InputFactoryProvider.class.getName(), inputP, inputP.getProperties());
        OutputFactoryProviderImpl outputP = new OutputFactoryProviderImpl();
        ctxt.registerService(Stax2OutputFactoryProvider.class.getName(), outputP, outputP.getProperties());
        ValidationSchemaFactoryProviderImpl[] impls = ValidationSchemaFactoryProviderImpl.createAll();
        for (int i = 0, len = impls.length; i < len; ++i) {
            ValidationSchemaFactoryProviderImpl impl = impls[i];
            ctxt.registerService(Stax2ValidationSchemaFactoryProvider.class.getName(), impl, impl.getProperties());
        }
    }
1257497
public static Builder newBuilder(Class<?> loggingClass) {
    if (loggingClass == null) throw new NullPointerException("loggingClass == null");
    return new Builder(Logger.getLogger(loggingClass.getName()));
  }