use of org.whole.lang.artifacts.util.IArtifactsOperations in project whole by wholeplatform.
the class ArtifactsSynchronizerVisitor method synchronize.
@SuppressWarnings({ "unchecked", "rawtypes" })
public static IArtifactsEntity synchronize(IArtifactsEntity entity, Traverse traverse, Synchronize synchronize, IBindingManager bindings, IPersistenceKit defaultPersistenceKit, boolean isLoading) {
Object rootResource = bindings.wGetValue("rootResource");
IArtifactsOperations<Object> artifactsOperations = (IArtifactsOperations<Object>) bindings.wGetValue("artifactsOperations");
ArtifactsSynchronizerVisitor<?> visitor = new ArtifactsSynchronizerVisitor(artifactsOperations, rootResource, traverse, synchronize, isLoading);
IArtifactsEntity result = visitor.initialize(entity);
result.accept(visitor);
if (!isLoading)
ArtifactsGeneratorOperation.generate(result, bindings);
else if (traverse.isFileContent()) {
Object context = artifactsOperations.getDescendant(rootResource, entity);
defaultPersistenceKit = calculateInheritedPersistence(entity, defaultPersistenceKit);
ArtifactsLoadFileContentsVisitor.loadContents(result, artifactsOperations, context, defaultPersistenceKit);
}
return result;
}
Aggregations