Examples of NameType


Examples of com.baulsupp.kolja.log.line.type.NameType

  private BytesType parseLongType(Element e) {
    return new BytesType(e.getAttribute("name"), getNullValue(e));
  }

  private NameType parseNameType(Element e) {
    return new NameType(e.getAttribute("name"), getNullValue(e));
  }
View Full Code Here

Examples of com.baulsupp.kolja.log.line.type.NameType

  private BytesType parseLongType(Element e) {
    return new BytesType(e.getAttribute("name"));
  }

  private NameType parseNameType(Element e) {
    return new NameType(e.getAttribute("name"));
  }
View Full Code Here

Examples of com.edugility.nomen.NameType

    if (name == null) {
      returnValue = this.isNextResolveable(null);
    } else if (this.isTarget(name)) {
      returnValue = true;
    } else {
      final Name n = this.getName(new NameType(name));
      if (n == null) {
        returnValue = this.isNextResolveable(null);
      } else {
        if (this.variableResolvers == null) {
          this.variableResolvers = new HashMap<String, VariableResolver>();
View Full Code Here

Examples of com.edugility.nomen.NameType

   *
   * @exception IllegalArgumentException if either {@code named} or
   * {@code name} is {@code null}
   */
  protected NameResolver createNameResolver(final Named named, final String name) {
    return new NameResolver(named, new NameType(name));
  }
View Full Code Here

Examples of com.ibm.icu.text.TimeZoneNames.NameType

      assert (style == LONG || style == SHORT || style == SHORT_COMMONLY_USED);

      // Gets the name directly from TimeZoneNames
      long date = System.currentTimeMillis();
      TimeZoneNames tznames = TimeZoneNames.getInstance(locale);
      NameType nameType = null;
      switch (style) {
      case LONG:
        nameType = daylight ? NameType.LONG_DAYLIGHT : NameType.LONG_STANDARD;
        break;
      case SHORT:
View Full Code Here

Examples of com.ibm.icu.text.TimeZoneNames.NameType

    if (tzID == null) {
      return null;
    }

    // Try to get a name from time zone first
    NameType nameType = (type == GenericNameType.LONG) ? NameType.LONG_GENERIC : NameType.SHORT_GENERIC;
    String name = _tznames.getTimeZoneDisplayName(tzID, nameType);

    if (name != null) {
      return name;
    }

    // Try meta zone
    String mzID = _tznames.getMetaZoneID(tzID, date);
    if (mzID != null) {
      boolean useStandard = false;
      int[] offsets = { 0, 0 };
      tz.getOffset(date, false, offsets);

      if (offsets[1] == 0) {
        useStandard = true;
        // Check if the zone actually uses daylight saving time around the time
        if (tz instanceof BasicTimeZone) {
          BasicTimeZone btz = (BasicTimeZone) tz;
          TimeZoneTransition before = btz.getPreviousTransition(date, true);
          if (before != null && (date - before.getTime() < DST_CHECK_RANGE) && before.getFrom().getDSTSavings() != 0) {
            useStandard = false;
          } else {
            TimeZoneTransition after = btz.getNextTransition(date, false);
            if (after != null && (after.getTime() - date < DST_CHECK_RANGE) && after.getTo().getDSTSavings() != 0) {
              useStandard = false;
            }
          }
        } else {
          // If not BasicTimeZone... only if the instance is not an ICU's implementation.
          // We may get a wrong answer in edge case, but it should practically work OK.
          int[] tmpOffsets = new int[2];
          tz.getOffset(date - DST_CHECK_RANGE, false, tmpOffsets);
          if (tmpOffsets[1] != 0) {
            useStandard = false;
          } else {
            tz.getOffset(date + DST_CHECK_RANGE, false, tmpOffsets);
            if (tmpOffsets[1] != 0) {
              useStandard = false;
            }
          }
        }
      }
      if (useStandard) {
        NameType stdNameType = (nameType == NameType.LONG_GENERIC) ? NameType.LONG_STANDARD : NameType.SHORT_STANDARD;
        String stdName = _tznames.getDisplayName(tzID, stdNameType, date);
        if (stdName != null) {
          name = stdName;

          // TODO: revisit this issue later
View Full Code Here

Examples of net.sourceforge.cardme.vcard.types.NameType

    /* This string will work just fine as the fold is in the middle of a word */
    final String correctNote = "Lines seem to be unfolded correctly if spaces aren't exactly on a folding boundary.";
   
    VCard vcard = new VCardImpl();
    vcard.setVersion(new VersionType(VCardVersion.V3_0));
    vcard.setName(new NameType("Some Name"));
    vcard.addNote(new NoteType(correctNote));

    VCardWriter writer = new VCardWriter();
    writer.setVCard(vcard);
    String vcardString = writer.buildVCardString();
   
    VCardEngine vcardEngine = new VCardEngine(CompatibilityMode.RFC2426);
    VCard parsedVcard = vcardEngine.parse(vcardString);
   
    assertNotNull(parsedVcard);
    assertTrue(parsedVcard.hasNotes());
    assertTrue(parsedVcard.getNotes().size() == 1);

    String parsedNote = parsedVcard.getNotes().get(0).getNote();
    assertEquals(correctNote, parsedNote);
   
    //------------------------------------------------------
   
    /* This string has the fold right at a space and the space is lost when retrieving it later */
    final String incorrectNote = "Lines seem to be unfolded incorrectly if spaces are just exactly on a folding boundary.";
   
    vcard = new VCardImpl();
    vcard.setVersion(new VersionType(VCardVersion.V3_0));
    vcard.setName(new NameType("Some Name"));
    vcard.addNote(new NoteType(incorrectNote));

    writer = new VCardWriter();
    writer.setVCard(vcard);
    vcardString = writer.buildVCardString();
View Full Code Here

Examples of net.sourceforge.cardme.vcard.types.NameType

  private static VCardImpl getFullVCardNoErrors() throws IOException, URISyntaxException
  {
    VCardImpl vcard = new VCardImpl();
    vcard.setVersion(new VersionType(VCardVersion.V3_0));
   
    NameType name = new NameType();
    name.setName("VCard for John Doe");
    vcard.setName(name);
   
    ProfileType profile = new ProfileType();
    profile.setProfile("VCard");
    vcard.setProfile(profile);
View Full Code Here

Examples of net.sourceforge.cardme.vcard.types.NameType

  }
 
  @Test
  public void testBuildNameType() throws VCardBuildException {
    VCardImpl vcard = getSimpleVCard();
    vcard.setName(new NameType("VCard for John Doe"));
   
    VCardWriter vcardWriter = new VCardWriter();
    vcardWriter.setOutputVersion(VCardVersion.V3_0);
    vcardWriter.setCompatibilityMode(CompatibilityMode.RFC2426);
    vcardWriter.setFoldingScheme(FoldingScheme.MIME_DIR);
View Full Code Here

Examples of net.sourceforge.cardme.vcard.types.NameType

   * @param vcard
   * @throws VCardParseException
   */
  private void parseNameType(String group, String value, List<ParameterType> paramTypeList, VCardImpl vcard) throws VCardParseException {
    try {
      NameType nameType = new NameType();
      parseParamTypes(nameType, paramTypeList, value, VCardTypeName.NAME);
     
      if(nameType.isQuotedPrintable()) {
        value = decodeQuotedPrintableValue(nameType, value);
      }
     
      if(group != null) {
        nameType.setGroup(group);
      }
     
      nameType.setName(VCardUtils.unescapeString(value));
      vcard.setName(nameType);
    }
    catch(Exception ex) {
      throw new VCardParseException("NameType ("+VCardTypeName.NAME.getType()+") ["+ex.getClass().getName()+"] "+ex.getMessage(), ex);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.