it.tidalwave.util.Key.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中it.tidalwave.util.Key.<init>()方法的一些代码示例,展示了Key.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key.<init>()方法的具体详情如下:
包路径:it.tidalwave.util.Key
类名称:Key
方法名:<init>

Key.<init>介绍

暂无

代码示例

代码示例来源:origin: it.tidalwave.northernwind/it-tidalwave-northernwind-core-default

@Override @Nonnull
 protected String filter (final @Nonnull Matcher matcher)
  {
   try
    {
     final String propertyName = matcher.group(1);
     return context.get().getNodeProperties().getProperty(new Key<String>(propertyName), "");
    }
   catch (IOException e)
    {
     return "ERR";
    }
  }
}

代码示例来源:origin: it.tidalwave.northernwind/it-tidalwave-northernwind-core-default

@Override @Nonnull
 protected String filter (final @Nonnull Matcher matcher)
  {
   try
    {
     final String propertyName = matcher.group(1);
     return requestContext.get().getContentProperties().getProperty(new Key<String>(propertyName), "");
    }
   catch (IOException e)
    {
     return "ERR";
    }
  }
}

代码示例来源:origin: it.tidalwave.northernwind/it-tidalwave-northernwind-core-default

propertyMap.put(new Key<>(s), value);
otherMap.put(new Key<>(x[1]), value);

代码示例来源:origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-core

/*******************************************************************************************************************
  *
  *
  ******************************************************************************************************************/
 @PostConstruct
 private void loadProperties()
  throws IOException
  {
   log.trace("loadProperties() for /{}", file.getPath());
       
   final Map<Key<?>, Object> map = new HashMap<Key<?>, Object>();
   for (final FileObject propertyFile : Utilities.getInheritedPropertyFiles(file, "Resource_en.properties"))
    {
     log.trace(">>>> reading properties from /{}...", propertyFile.getPath());
     @Cleanup final Reader r = new InputStreamReader(propertyFile.getInputStream());
     final Properties tempProperties = new Properties();
     tempProperties.load(r);
     log.trace(">>>> local properties: {}", tempProperties);
     r.close();        
     
     for (final Entry<Object, Object> entry : tempProperties.entrySet())
      {
       map.put(new Key<Object>(entry.getKey().toString()), entry.getValue());
      }
    }
   properties = new TypeSafeHashMap(map);
   log.debug(">>>> properties for /{}: {}", file.getPath(), properties);
  }
}

代码示例来源:origin: it.tidalwave.northernwind/it-tidalwave-northernwind-core-default

@Override @Nonnull
 protected String filter (final @Nonnull Matcher matcher)
  {
   try
    {
     // FIXME: should be pushed into @PostConstruct, but can't - see NW-224
     final Site site = siteProvider.get().getSite();
     final SiteNode rootSiteNode = site.find(SiteNode).withRelativeUri("/").result(); // See NW-223
     // END FIXME
     final String propertyName = matcher.group(1);
     return rootSiteNode.getProperties().getProperty(new Key<String>(propertyName), "");
    }
   catch (NotFoundException | IOException e)
    {
     return "ERR";
    }
  }
}

代码示例来源:origin: it.tidalwave.bluebill/it-tidalwave-bluebill-factsheet-bbc

@Nonnull
 public As unmarshal (final @Nonnull List<Statement> statements, final @Nonnull Context context)
  {
   final Id id = findId(statements, context);
   Biblio biblio = new Biblio(id);
   for (final Statement statement : statements)
    {
     final String predicate = statement.getPredicate().stringValue();
     if (predicate.startsWith(NS_DC_TERMS))
      {
       final Key<Object> key = new Key<Object>(predicate);
       biblio = biblio.with(key, deserialize(statement.getObject()));
      }
     else if (!predicate.equals(TYPE_RDF_TYPE.stringValue())
          && !predicate.equals(ID_FOAF_PRIMARY_TOPIC.stringValue()))
      {
       System.err.println("BIBLIO Unused statement: " + statement);
      }
    }
   return biblio;
  }
}

代码示例来源:origin: it.tidalwave.bluebill/it-tidalwave-bluebill-taxonomy-mobile

document = document.with(new Key<Object>(predicate), object.stringValue());

代码示例来源:origin: it.tidalwave.bluebill/it-tidalwave-bluebill-factsheet-bbc

@Nonnull
 public As unmarshal (final @Nonnull List<Statement> statements, final @Nonnull Context context)
  {
   final Id id = findId(statements, context);
   Media movie = new Media().with(Media.ID, id).with(DC_RIGHTS, BBC_SYNDICATION_GUIDELINES);
   for (final Statement statement : statements)
    {
     final String predicate = statement.getPredicate().stringValue();
     if (predicate.startsWith(NS_DC_TERMS))
      {
       final Key<Object> key = new Key<Object>(predicate);
       movie = movie.with(key, deserialize(statement.getObject()));
      }
     else if (!predicate.equals(TYPE_RDF_TYPE.stringValue())
          && !predicate.equals(BbcVocabulary.ID_PO_SUBJECT.stringValue()))
      {
       System.err.println("MOVIE Unused statement: " + statement);
      }
    }
   return movie;
  }
}

代码示例来源:origin: it.tidalwave.bluebill/it-tidalwave-bluebill-factsheet

@Override @Nonnull
 public As unmarshal (final @Nonnull List<Statement> statements, final @Nonnull Context context)
  {
   final Id id = new Id(statements.get(0).getSubject().stringValue());
   Media media = new Media().with(Media.ID, id);
   for (final Statement statement : statements)
    {
     final Value object = statement.getObject();
     final Id predicate = new Id(statement.getPredicate().stringValue());
     final Key<Object> key = new Key<Object>(predicate);
     if (PREDICATES_REFERRING_ENTITIES.contains(predicate))
      {
       media = media.with(key, context.find(object));
      }
     else if (PREDICATES_REFERRING_IDS.contains(predicate))
      {
       media = media.with(key, new Id(object.stringValue()));
      }
     else if (object instanceof Literal)
      {
       media = media.with(key, object.stringValue());
      }
    }
   return media;
  }
}

代码示例来源:origin: it.tidalwave.northernwind/it-tidalwave-northernwind-core-default

final Key<String> propertyKey = new Key<>(propertyName);
log.trace(">>>>>>>> setting property {} = {}", propertyKey.stringValue(), e.getValue());
when(properties.getProperty(eq(propertyKey))).thenReturn(e.getValue());

代码示例来源:origin: it.tidalwave.bluebill/it-tidalwave-bluebill-factsheet

final Key<Object> key = new Key<Object>(predicate);

代码示例来源:origin: it.tidalwave.northernwind/it-tidalwave-northernwind-frontend-components

/*******************************************************************************************************************
 *
 * {@inheritDoc}
 *
 ******************************************************************************************************************/
@Nonnull
protected String loadTemplate (final @Nonnull GalleryAdapterContext context, final @Nonnull String templateName)
 throws IOException
 {
  try
   {
    final SiteNode siteNode = context.getSiteNode();
    final GalleryView view = context.getView();
    final Site site = context.getSite();
    final ResourceProperties viewProperties = siteNode.getPropertyGroup(view.getId());
    final String templateRelativePath = viewProperties.getProperty(new Key<String>(templateName + "Path"));
    final Content template = site.find(Content).withRelativePath(templateRelativePath).result();
    return template.getProperties().getProperty(PROPERTY_TEMPLATE);
   }
  catch (NotFoundException e)
   {
    return loadDefaultTemplate(templateName + ".txt");
   }
 }

代码示例来源:origin: it.tidalwave.bluebill/it-tidalwave-bluebill-factsheet-bbc

final Key<Object> key = new Key<Object>(predicate);
factSheet = factSheet.with(key, context.find(object));
final Key<Object> key = new Key<Object>(predicate);
factSheet = factSheet.with(key, context.find(object));
 || predicate.startsWith(NS_DC_TERMS))
final Key<Object> key = new Key<Object>(predicate);
factSheet = factSheet.with(key, deserialize(object));

代码示例来源:origin: it.tidalwave.bluemarine2/it-tidalwave-bluemarine2-model

final Key<Object> key = new Key<>("tag." + fieldKey.name());
final List<String> values = tag.getAll(fieldKey);

相关文章

微信公众号

最新文章

更多