org.modeshape.jcr.ExecutionContext.getValueFactories()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(83)

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

ExecutionContext.getValueFactories介绍

[英]Get the factories that should be used to create values for Property.
[中]获取应用于为属性创建值的工厂。

代码示例

代码示例来源:origin: org.fcrepo/modeshape-jcr

public AllPathsCache( NodeCache cache,
           NodeCache removedCache,
           ExecutionContext context ) {
  this.cache = cache;
  this.removedCache = removedCache;
  this.pathFactory = context.getValueFactories().getPathFactory();
}

代码示例来源:origin: ModeShape/modeshape

public AllPathsCache( NodeCache cache,
           NodeCache removedCache,
           ExecutionContext context ) {
  this.cache = cache;
  this.removedCache = removedCache;
  this.pathFactory = context.getValueFactories().getPathFactory();
}

代码示例来源:origin: ModeShape/modeshape

protected ReferenceConstraintChecker( String[] valueConstraints,
                   ExecutionContext context ) {
  this.context = context;
  NameFactory factory = context.getValueFactories().getNameFactory();
  constraints = new Name[valueConstraints.length];
  for (int i = 0; i < valueConstraints.length; i++) {
    constraints[i] = factory.create(valueConstraints[i]);
  }
}

代码示例来源:origin: ModeShape/modeshape

protected BooleanConstraintChecker( ExecutionContext executionContext,
                  String... constraints ) {
  this.valueFactories = executionContext.getValueFactories();
  if (constraints != null && constraints.length > 0) {
    constraint = valueFactories.getBooleanFactory().create(constraints[0]);
  } else {
    constraint = null;
  }
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

@Override
public void setDefaultPrimaryTypeName( String defaultPrimaryType ) throws ConstraintViolationException {
  if (defaultPrimaryType == null || defaultPrimaryType.trim().length() == 0) {
    this.defaultPrimaryType = null;
  } else {
    try {
      this.defaultPrimaryType = getContext().getValueFactories().getNameFactory().create(defaultPrimaryType);
    } catch (ValueFormatException vfe) {
      throw new ConstraintViolationException(vfe);
    }
  }
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected AbstractSessionCache(ExecutionContext context,
                WorkspaceCache sharedWorkspaceCache) {
  this.logger = Logger.getLogger(getClass());
  this.context = context;
  this.sharedWorkspaceCache = sharedWorkspaceCache;
  this.workspaceCache.set(sharedWorkspaceCache);
  ValueFactories factories = this.context.getValueFactories();
  this.nameFactory = factories.getNameFactory();
  this.pathFactory = factories.getPathFactory();
  this.rootPath = this.pathFactory.createRootPath();
}

代码示例来源:origin: ModeShape/modeshape

public void setName( String name ) throws ConstraintViolationException {
  if (name == null) {
    throw new ConstraintViolationException();
  }
  try {
    this.name = context.getValueFactories().getNameFactory().create(name);
  } catch (ValueFormatException vfe) {
    throw new ConstraintViolationException(vfe);
  }
}

代码示例来源:origin: ModeShape/modeshape

protected LegacySidecarExtraPropertyStore( FileSystemConnector connector ) {
  this.connector = connector;
  this.registry = this.connector.registry();
  this.propertyFactory = this.connector.getContext().getPropertyFactory();
  this.factories = this.connector.getContext().getValueFactories();
  this.stringFactory = factories.getStringFactory();
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

public boolean canSetProperty( JcrSession session,
                String propertyName,
                Value[] values ) {
  CheckArg.isNotNull(propertyName, "propertyName");
  if (values == null || values.length == 0) {
    return canRemoveProperty(propertyName);
  }
  Name name = context.getValueFactories().getNameFactory().create(propertyName);
  // Reuse the logic in RepositoryNodeTypeManager ...
  return nodeTypes().findPropertyDefinition(session, this.name, null, name, values, true) != null;
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

private NodeTypeMatcher nodeTypePredicate( NodeTypes nodeTypes,
                      IndexDefinition defn ) {
  // Get the indexed node type ...
  String indexedNodeType = defn.getNodeTypeName();
  Name indexedNodeTypeName = context().getValueFactories().getNameFactory().create(indexedNodeType);
  Set<Name> allNodeTypes = nodeTypes.getAllSubtypes(indexedNodeTypeName);
  assert allNodeTypes != null;
  return NodeTypeMatcher.create(allNodeTypes, nodeTypes);
}

代码示例来源:origin: ModeShape/modeshape

public boolean canSetProperty( JcrSession session,
                String propertyName,
                Value[] values ) {
  CheckArg.isNotNull(propertyName, "propertyName");
  if (values == null || values.length == 0) {
    return canRemoveProperty(propertyName);
  }
  Name name = context.getValueFactories().getNameFactory().create(propertyName);
  // Reuse the logic in RepositoryNodeTypeManager ...
  return nodeTypes().findPropertyDefinition(session, this.name, null, name, values, true) != null;
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

RepositoryLockManager with( JcrRepository.RunningState repository,
              RepositoryConfiguration.GarbageCollection gcConfig ) {
  assert this.systemWorkspaceName == repository.repositoryCache().getSystemWorkspaceName();
  assert this.processId == repository.context().getProcessId();
  PathFactory pathFactory = repository.context().getValueFactories().getPathFactory();
  Path locksPath = pathFactory.create(pathFactory.createRootPath(), JcrLexicon.SYSTEM, ModeShapeLexicon.LOCKS);
  assert this.locksPath.equals(locksPath);
  return new RepositoryLockManager(repository, gcConfig);
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

@Override
public boolean getBoolean() throws RepositoryException {
  checkSession();
  try {
    return context().getValueFactories().getBooleanFactory().create(property().getFirstValue());
  } catch (org.modeshape.jcr.value.ValueFormatException e) {
    throw new ValueFormatException(e.getMessage(), e);
  }
}

代码示例来源:origin: ModeShape/modeshape

SystemContent( SessionCache systemCache ) {
  this.system = systemCache;
  ExecutionContext context = systemCache.getContext();
  this.propertyFactory = context.getPropertyFactory();
  ValueFactories factories = context.getValueFactories();
  this.booleans = factories.getBooleanFactory();
  this.strings = factories.getStringFactory();
  this.names = factories.getNameFactory();
  this.referenceFactory = factories.getReferenceFactory();
  this.weakReferenceFactory = factories.getWeakReferenceFactory();
  this.jcrValues = new JcrValueFactory(context);
}

代码示例来源:origin: ModeShape/modeshape

@Override
public Calendar getDate() throws RepositoryException {
  checkSession();
  try {
    return context().getValueFactories().getDateFactory().create(property().getFirstValue()).toCalendar();
  } catch (org.modeshape.jcr.value.ValueFormatException e) {
    throw new ValueFormatException(e.getMessage(), e);
  }
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

@Override
public JcrNodeType getNodeType( String nodeTypeName ) throws NoSuchNodeTypeException, RepositoryException {
  session.checkLive();
  Name ntName = context().getValueFactories().getNameFactory().create(nodeTypeName);
  JcrNodeType type = nodeTypes().getNodeType(ntName);
  if (type != null) {
    type = type.with(context(), session);
    return type;
  }
  throw new NoSuchNodeTypeException(JcrI18n.typeNotFound.text(nodeTypeName));
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

private void writeInitializedAt() {
  LOGGER.debug("Marking repository '{0}' as fully initialized", name);
  LocalDocumentStore store = documentStore().localStore();
  EditableDocument repositoryInfo = store.edit(REPOSITORY_INFO_KEY, true);
  if (repositoryInfo.get(REPOSITORY_INITIALIZED_AT_FIELD_NAME) == null) {
    DateTime now = context().getValueFactories().getDateFactory().create();
    repositoryInfo.setDate(REPOSITORY_INITIALIZED_AT_FIELD_NAME, now.toDate());
  }
  LOGGER.debug("Repository '{0}' is fully initialized", name);
}

代码示例来源:origin: ModeShape/modeshape

@Override
@Before
public void beforeEach() {
  super.beforeEach();
  this.context = new ExecutionContext();
  this.bufferMgr = new BufferManager(context);
  this.types = new ValueTypeSystem(context.getValueFactories());
}

代码示例来源:origin: ModeShape/modeshape

@Override
@Before
public void beforeEach() {
  super.beforeEach();
  this.context = new ExecutionContext();
  this.bufferMgr = new BufferManager(context);
  this.types = new ValueTypeSystem(context.getValueFactories());
}

代码示例来源:origin: ModeShape/modeshape

@Test
public void shouldConvertValuesToCoreTypes() {
  ExecutionContext ctx = new ExecutionContext();
  Name n1 = ctx.getValueFactories().getNameFactory().create("mix:title");
  Name n2 = ctx.getValueFactories().getNameFactory().create("mix:titl");
  index.add(key("key8"), "mixinTypes", new Object[]{n1});
  index.commit();
  
  SetCriteria sc = new SetCriteria(propertyValue(def4), new Literal(n1), new Literal(n2));
  validate(sc, "key8");
}

相关文章