/** * Add all children as candidates * * @param root the root context * @param parent the parent context * @param metaData the structure meta data * @param deployers the structure deployers * @throws Exception for any error */ protected void addAllChildren(VirtualFile root, VirtualFile parent, StructureMetaData metaData, VFSStructuralDeployers deployers) throws Exception { addChildren(root, parent, metaData, deployers, null); }
public boolean accepts(DeploymentUnit unit) { return doAccepts(unit); } }
public boolean accepts(DeploymentUnit unit) { return (unit instanceof VFSDeploymentUnit) && accepts((VFSDeploymentUnit)unit); } }
public VirtualFileVisitor createVisitor(StructureContext context, VisitorAttributes attributes) throws Exception { AbstractCandidateStructureVisitor visitor = new AbstractCandidateStructureVisitor(context, attributes); if (filter != null) visitor.setFilter(filter); return visitor; } }
/** * Get the relative path between two virtual files * * @param context the structure context * @param child the child * @return the relative path */ public static String getRelativePath(StructureContext context, VirtualFile child) { if (context == null) throw new IllegalArgumentException("Null context"); return getRelativePath(context.getParent(), child); }
/** * Tests whether the virtual file is a leaf * * @param file the virtual file * @return true when it is a leaf * @throws IOException for any error */ protected boolean isLeaf(VirtualFile file) throws IOException { return SecurityActions.isLeaf(file); }
/** * Add all children as candidates * * @param root the root context * @param parent the parent context * @param metaData the structure meta data * @param deployers the structure deployers * @param attributes the visitor attributes uses {@link VisitorAttributes#DEFAULT} when null * @throws Exception for any error */ protected void addChildren(VirtualFile root, VirtualFile parent, StructureMetaData metaData, VFSStructuralDeployers deployers, VisitorAttributes attributes) throws Exception { if (parent == null) throw new IllegalArgumentException("Null parent"); VirtualFileVisitor visitor = candidateStructureVisitorFactory.createVisitor(root, parent, metaData, deployers, attributes); parent.visit(visitor); }
/** * Create a context * * @param context the structure context * @param metaDataPaths the metadata paths * @return the context info * @throws IllegalArgumentException for a null root or structure metaData */ protected ContextInfo createContext(StructureContext context, String[] metaDataPaths) { ContextInfo result = applyMetadataPaths(context, metaDataPaths); applyStructure(context, result); return result; }
/** * Create a context * * @param context the structure context * @param metaDataPath the metadata path * @return the context info * @throws IllegalArgumentException for a null root or structure metaData */ protected ContextInfo createContext(StructureContext context, String metaDataPath) { ContextInfo result = applyMetadataPath(context, metaDataPath); applyStructure(context, result); return result; }
/** * Create a context * * @param context the structure context * @return the context info * @throws IllegalArgumentException for a null root or structure metaData */ protected ContextInfo createContext(StructureContext context) { return createContext(context, (String) null); }
/** * Create metadata entry. * * @param context the structure context * @param info the context info * @param path the path * @param type the type */ protected void addMetaDataPath(StructureContext context, ContextInfo info, String path, MetaDataType type) { VirtualFile root = context.getFile(); if (root.getChild(path).exists()) info.addMetaDataPath(createMetaDataEntry(path, type)); }
public VirtualFileVisitor createVisitor(VirtualFile root, VirtualFile parent, StructureMetaData metaData, VFSStructuralDeployers deployers, VisitorAttributes attributes) throws Exception { AbstractCandidateStructureVisitor visitor = new AbstractCandidateStructureVisitor(root, parent, metaData, deployers, attributes); if (filter != null) visitor.setFilter(filter); return visitor; } }
/** * Add all children as candidates * * @param context the structure context * @throws Exception for any error */ protected void addAllChildren(StructureContext context) throws Exception { addChildren(context, null); }
/** * Tests whether the virtual file is a leaf * * @param file the virtual file * @return true when it is a leaf */ protected static boolean isLeaf(VirtualFile file) { return SecurityActions.isLeaf(file); }
/** * Add all children as candidates * * @param context the structure context * @param attributes the visitor attributes uses {@link VisitorAttributes#DEFAULT} when null * @throws Exception for any error */ protected void addChildren(StructureContext context, VisitorAttributes attributes) throws Exception { if (context == null) throw new IllegalArgumentException("Null context"); VirtualFile file = context.getFile(); VirtualFileVisitor visitor = candidateStructureVisitorFactory.createVisitor(context, attributes); file.visit(visitor); }
public boolean accepts(VFSDeploymentUnit unit) { return doAccepts(unit); }
/** * Add all children as candidates * * @param root the root context * @param parent the parent context * @param metaData the structure meta data * @param deployers the structure deployers * @throws Exception for any error */ protected void addAllChildren(VirtualFile root, VirtualFile parent, StructureMetaData metaData, VFSStructuralDeployers deployers) throws Exception { addChildren(root, parent, metaData, deployers, null); }
/** * Add all children as candidates * * @param root the root context * @param parent the parent context * @param metaData the structure meta data * @param deployers the structure deployers * @param attributes the visitor attributes uses {@link VisitorAttributes#DEFAULT} when null * @throws Exception for any error */ protected void addChildren(VirtualFile root, VirtualFile parent, StructureMetaData metaData, VFSStructuralDeployers deployers, VisitorAttributes attributes) throws Exception { if (parent == null) throw new IllegalArgumentException("Null parent"); StructureContext context = new StructureContext(root, null, parent, metaData, deployers, null); addChildren(context, attributes); }