Package hirondelle.web4j.model

Examples of hirondelle.web4j.model.Code


   This item is package-private. The {@link CodeTable#codeFor(Id, CodeTable)} method is a <tt>public</tt>
   version of this method, and simply does a call forward to this one. The reason is simply to reduce the number
   of imports needed in Model Objects that use Codes from 3 to 2 : {@link Code} and {@link CodeTable}.
  */
  static Code populate(Id aCodeId, CodeTable aCodeTable){
    Code result = null;
    Map<Id, Code> codeTable = fAllCodeTables.get(aCodeTable);
    if ( codeTable == null ){
      throw new RuntimeException("Cannot populate item. Unknown code table " + Util.quote(aCodeTable));
    }
    if ( aCodeId != null ){
View Full Code Here


  */
  private static Map<Id, Code> getRatings() throws DAOException {
    Map<Id, Code> result = new LinkedHashMap<Id, Code>();
    for(int idx=0; idx <= 10; ++idx ){
      Id id  = new Id(new Integer(idx).toString());
      Code code = null;
      try {
        code = new Code(id, SafeText.from(id.toString()));
      }
      catch (ModelCtorException ex){
        throw new DAOException("Cannot build Code in expected manner.",ex);     
      }
      result.put(id, code);
View Full Code Here

  /** Translate Locale id into text. If not present, return <tt>null</tt>. */
  private Locale fetchLocale(){
    Locale result = null;
    String localeId = getParamUnsafe(LOCALE_ID);
    if ( Util.textHasContent(localeId) ){
      Code code = CodeTable.codeFor( Id.from(localeId), CodeTable.SUPPORTED_LOCALES);
      result = Util.buildLocale(code.getText().getRawString());
    }
    return result;
  }
View Full Code Here

   This item is package-private. The {@link CodeTable#codeFor(Id, CodeTable)} method is a <tt>public</tt>
   version of this method, and simply does a call-forward to this one. The reason is simply to reduce the number
   of imports needed in Model Objects that use Codes from 3 to 2 : {@link Code} and {@link CodeTable}.
  */
  static Code populate(Id aCodeId, CodeTable aCodeTable){
    Code result = null;
    Map<Id, Code> codeTable = fAllCodeTables.get(aCodeTable);
    if ( codeTable == null ){
      throw new RuntimeException("Cannot populate item. Unknown code table " + Util.quote(aCodeTable));
    }
    if ( aCodeId != null ){
View Full Code Here

    else if ( aObject instanceof TimeZone ) {
      TimeZone timeZone = (TimeZone)aObject;
      result = timeZone.getID();
    }
    else if ( aObject instanceof Code ) {
      Code code = (Code)aObject;
      result = code.getId().getRawString();
    }
    else if ( aObject instanceof Id ) {
      Id id = (Id)aObject;
      result = id.getRawString();
    }
View Full Code Here

    else if (aObject instanceof Id){
      Id id = (Id) aObject;
      result = id.getRawString();
    }
    else if (aObject instanceof Code){
      Code code = (Code) aObject;
      result = code.getText().getRawString();
    }
    else if (aObject instanceof String) {
      result = aObject.toString();
    }
    else if ( aObject instanceof DateTime ){
View Full Code Here

TOP

Related Classes of hirondelle.web4j.model.Code

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.