Package org.crank.core

Examples of org.crank.core.ObjectRegistry


    employee = new EmployeeMock();
    employee.setAddress(new AddressMock());
    employee.setDepartment(new DepartmentMock());
    employee.getDepartment().setAddress(new AddressMock());
    employee.getDepartment().getAddress().setLine1("foo bar");
    ObjectRegistry objectRegistry = CrankContext.getObjectRegistry();
    SpringApplicationContextObjectRegistry sacObjectRegistry = (SpringApplicationContextObjectRegistry) objectRegistry;
    sacObjectRegistry.setApplicationContext(this.applicationContext);
  }
View Full Code Here


     *
     * @return field validator
     */
    private FieldValidator lookupValidatorInRegistry(
            String validationMetaDataName) {
        ObjectRegistry applicationContext = CrankContext.getObjectRegistry();

        return (FieldValidator) applicationContext
                .getObject(CrankConstants.FRAMEWORK_PREFIX
                        + CrankConstants.FRAMEWORK_DELIM + "validator"
                        + CrankConstants.FRAMEWORK_DELIM
                        + validationMetaDataName, FieldValidator.class);
    }
View Full Code Here

     *            The name of the validator that we are looking up.
     *
     * @return
     */
    private FieldValidator lookupValidatorInRegistry(String validator) {
        ObjectRegistry applicationContext = CrankContext.getObjectRegistry();

        FieldValidator fvalidator = (FieldValidator) applicationContext.getObject(
                CrankConstants.FRAMEWORK_PREFIX + CrankConstants.FRAMEWORK_DELIM
                        + "validator" + CrankConstants.FRAMEWORK_DELIM + validator,
                FieldValidator.class);
        return fvalidator;
    }
View Full Code Here

    try {
      Serializable entityId = CrudUtils.getIdObject(value, this.idType);
            logger.debug(String.format("entityId %s", entityId));
            if (dao == null) {
        ObjectRegistry objectRegistry = CrankContext
            .getObjectRegistry();
        Map<String, GenericDao> repos = (Map<String, GenericDao>) objectRegistry
            .getObject("repos");

        if (managedObject != null) {
                    logger.debug("Looking up DAO by managedObject");
                    dao = repos.get(managedObject.getName());
View Full Code Here

   *
   * @return
   */
  private FieldValidator lookupValidatorInRegistry(
      String validationMetaDataName) {
    ObjectRegistry applicationContext = CrankContext.getObjectRegistry();

    FieldValidator validator = (FieldValidator) applicationContext
        .getObject(CrankConstants.FRAMEWORK_PREFIX
            + CrankConstants.FRAMEWORK_DELIM + "validator"
            + CrankConstants.FRAMEWORK_DELIM
            + validationMetaDataName, FieldValidator.class);
    return validator;
View Full Code Here

        FacesContext facesContext, UIComponent component,
        String [] fieldName) {
        /* Try to read the validator out of the Spring context.
         * First lookup with id, if you don't find it with component id, use the client id.
         */
      ObjectRegistry applicationContext = CrankContext.getObjectRegistry();
        String componentId = component.getId();
        FieldValidator validator;
       
        try {
          /* Look up the more specific validator, e.g., EmployeeForm.age. */
            String clientId = component.getClientId(facesContext);
            validator = (FieldValidator) applicationContext.getObject(clientId);
        } catch (ObjectNotFound oe) {
          /* Look up the less specific validator, e.g., age. */
            validator = (FieldValidator) applicationContext.getObject(componentId);
        }
        return validator;
    }
View Full Code Here

TOP

Related Classes of org.crank.core.ObjectRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.