Java 类org.hibernate.annotations.common.util.StringHelper 实例源码

项目:lams    文件:Oracle8iDialect.java   
@Override
public String getQueryHintString(String sql, List<String> hints) {
    final String hint = StringHelper.join( ", ", hints.iterator() );

    if ( StringHelper.isEmpty( hint ) ) {
        return sql;
    }

    final int pos = sql.indexOf( "select" );
    if ( pos > -1 ) {
        final StringBuilder buffer = new StringBuilder( sql.length() + hint.length() + 8 );
        if ( pos > 0 ) {
            buffer.append( sql.substring( 0, pos ) );
        }
        buffer.append( "select /*+ " ).append( hint ).append( " */" )
                .append( sql.substring( pos + "select".length() ) );
        sql = buffer.toString();
    }

    return sql;
}
项目:bdf2    文件:AbstractConverter.java   
protected void fillDataSetAndDataPathProperty(Element element,ComponentInfo component,boolean isCollection){
    String[] dataSetDataPath=this.retriveDataSetAndDataPath(component);
    if(dataSetDataPath!=null){
        if(StringHelper.isNotEmpty(dataSetDataPath[0])){
            BaseElement dataSetElement=new BaseElement("Property"); 
            dataSetElement.addAttribute("name", "dataSet");
            dataSetElement.setText(dataSetDataPath[0]);
            element.add(dataSetElement);
        }
        if(StringHelper.isNotEmpty(dataSetDataPath[1]) && !hasDataPath(component)){
            BaseElement dataPathElement=new BaseElement("Property");
            dataPathElement.addAttribute("name", "dataPath");
            String dataPath=dataSetDataPath[1];
            if(!isCollection){
                int pos=dataPath.lastIndexOf(".");
                if(pos>0){
                    dataPath=dataPath.substring(0,pos)+".#"+dataPath.substring(pos+1,dataPath.length());
                }                   
            }

            dataPathElement.setText(dataPath);
            element.add(dataPathElement);
        }
    }
}
项目:bdf2    文件:AbstractConverter.java   
private String buildLayoutContraint(ComponentInfo component){
    StringBuffer sb=new StringBuffer();
    if(component.getLayoutConstraintProperties()!=null){
        int i=0;
        for(LayoutConstraintProperty lcp:component.getLayoutConstraintProperties()){
            if(StringHelper.isNotEmpty(lcp.getName()) && StringHelper.isNotEmpty(lcp.getValue())){
                if(i>0){
                    sb.append(";");
                }
                sb.append(lcp.getName()+":"+lcp.getValue());
                i++;
            }
        }
    }
    if(sb.length()>0){
        return sb.toString();           
    }else{
        return null;
    }
}
项目:bdf2    文件:AbstractConverter.java   
private Entity getTopEntity(Entity entity,StringBuffer dataPath){
    if(StringHelper.isEmpty(entity.getParentId())){
        if(dataPath.length()>0){
            dataPath.insert(0, "#");
        }
        return entity;
    }else{
        int pointPos=dataPath.indexOf(".");
        if(pointPos==-1){
            dataPath.insert(0, "."+entity.getName());               
        }else{
            dataPath.insert(0, ".#"+entity.getName());                              
        }
        return getTopEntity(entityManager.loadEntity(entity.getParentId()),dataPath);
    }
}
项目:bdf2    文件:MenuItemConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=MenuItem.class.getSimpleName();
    XmlNode node=MenuItem.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:DialogConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=Dialog.class.getSimpleName();
    XmlNode node=Dialog.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:ToolBarConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=ToolBar.class.getSimpleName();
    XmlNode node=ToolBar.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:DataColumnConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,Element rootElement)
        throws Exception {
    String name=DataColumn.class.getSimpleName();
    XmlNode node=DataColumn.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);

    boolean addProperty=true;
    for(ComponentProperty cp:component.getComponentProperties()){
        if(cp.getName().equals("property")){
            addProperty=false;
            break;
        }
    }
    if(addProperty){
        BaseElement propertyElement=new BaseElement("Property");
        propertyElement.addAttribute("name","property");
        propertyElement.setText(component.getName());
        element.add(propertyElement);
    }

    return element;
}
项目:bdf2    文件:AccordionConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=Accordion.class.getSimpleName();
    XmlNode node=Accordion.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:CustomDropDownConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=CustomDropDown.class.getSimpleName();
    XmlNode node=CustomDropDown.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:DataTreeConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=DataTree.class.getSimpleName();
    XmlNode node=DataTree.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    this.fillDataSetAndDataPathProperty(element, component,true);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:SplitPanelConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=SplitPanel.class.getSimpleName();
    XmlNode node=SplitPanel.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:SectionConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=Section.class.getSimpleName();
    XmlNode node=Section.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:ControlTabConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=ControlTab.class.getSimpleName();
    XmlNode node=ControlTab.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:DataGridConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,Element rootElement)
        throws Exception {
    String name=DataGrid.class.getSimpleName();
    XmlNode node=DataGrid.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    this.fillDataSetAndDataPathProperty(element, component,true);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:AutoFormConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,Element rootElement)
        throws Exception {
    String name=AutoForm.class.getSimpleName();
    XmlNode node=AutoForm.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    this.fillDataSetAndDataPathProperty(element, component,false);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }

    return element;
}
项目:bdf2    文件:ContainerConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=Container.class.getSimpleName();
    XmlNode node=Container.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:MenuConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=Menu.class.getSimpleName();
    XmlNode node=Menu.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:RadioGroupConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=RadioGroup.class.getSimpleName();
    XmlNode node=RadioGroup.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    this.fillDataSetAndDataPathProperty(element, component,false);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:ColumnGroupConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=ColumnGroup.class.getSimpleName();
    XmlNode node=ColumnGroup.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:TabControlConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=TabControl.class.getSimpleName();
    XmlNode node=TabControl.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:CommonPR.java   
private Map<String,Object> executeBeanshellScript(Map<String,Object> parameter){
    Map<String,Object> map=null;
    String beanShellScript=(String)parameter.get(Constants.BEAN_SHELL_SCRIPT);
    if(StringHelper.isNotEmpty(beanShellScript)){
        try{
            Object obj=generatorInterpreter(parameter).eval(beanShellScript);
            if(obj!=null){
                if(!(obj instanceof Map)){
                    throw new RuntimeException("BeanShell脚本:\r\r"+beanShellScript+"\r\r返回值是一个"+obj.getClass().getName()+"对象,而不是一个Map类型的对象!");
                }else{
                    map=(Map<String,Object>)obj;
                }               
            }
        }catch(EvalError e){
            throw new RuntimeException("BeanShell脚本:\r\r"+beanShellScript+"\r\r执行失败",e);
        }
    }
    return map;
}
项目:bdf2    文件:ViewBuilder.java   
private String buildLayout(PageInfo page){
    StringBuffer sb=new StringBuffer();
    if(StringHelper.isNotEmpty(page.getLayout())){
        sb.append(page.getLayout());
    }
    if(page.getLayoutProperties()!=null){
        int i=0;
        for(LayoutProperty lp:page.getLayoutProperties()){
            if(i==0){
                sb.append(" ");                 
            }
            if(StringHelper.isNotEmpty(lp.getName()) && StringHelper.isNotEmpty(lp.getValue())){
                if(i>0){
                    sb.append(";");
                }
                sb.append(lp.getName()+":"+lp.getValue());
                i++;
            }
        }
    }
    if(sb.length()>0){
        return sb.toString();
    }else{
        return null;
    }
}
项目:bdf2    文件:ViewBuilder.java   
private Element createDataSetElement(Entity entity,RuleSet ruleSet) throws Exception{
    if(StringHelper.isEmpty(entity.getParentId())){
        BaseElement element = generateDataSetElement(ruleSet);
        element.addAttribute("id", "dataSet"+entity.getName());
        String entityName=entity.getName();
        Element dataTypeElement=createPropertyElement("dataType","["+entityName+"]");
        element.add(dataTypeElement);
        Element dataProviderElement=createPropertyElement("dataProvider","dataProvider"+entityName.substring(0,1).toUpperCase()+entityName.substring(1,entityName.length()));
        element.add(dataProviderElement);
        element.add(createDataSetParameterElement(entity));
        if(entity.getPageSize()>0){
            Element pageSizeElement=createPropertyElement("pageSize",String.valueOf(entity.getPageSize()));
            element.add(pageSizeElement);
        }
        return element;         
    }else{
        return null;
    }
}
项目:bdf2    文件:ModelBuilder.java   
private BaseElement createDataType(Entity entity, RuleSet ruleSet)
        throws Exception {
    String nodeName=EntityDataType.class.getSimpleName();
    XmlNode xmlNode=EntityDataType.class.getAnnotation(XmlNode.class);
    if(xmlNode!=null && StringHelper.isNotEmpty(xmlNode.nodeName())){
        nodeName=xmlNode.nodeName();
    }
    Rule rule=ruleSet.getRule(nodeName);
    BaseElement dataTypeElement=new BaseElement(rule.getNodeName());
    dataTypeElement.addAttribute("name",entity.getName());
    if(entity.getEntityFields()!=null){
        for(EntityField field:entity.getEntityFields()){
            dataTypeElement.add(buildPropertyDefElement(field,ruleSet));
        }
    }
    return dataTypeElement;
}
项目:bdf2    文件:ModelBuilder.java   
private Element buildValidatorElement(Validator validator){
    BaseElement element=new BaseElement("Validator");
    int pos=validator.getName().lastIndexOf("Validator");
    String validatorType=validator.getName().substring(0,pos);
    validatorType=validatorType.substring(0,1).toLowerCase()+validatorType.substring(1,validatorType.length());
    element.addAttribute("type",validatorType);
    if(validator.getProperties()!=null){
        for(ValidatorProperty vp:validator.getProperties()){
            if(StringHelper.isNotEmpty(vp.getName()) && StringHelper.isNotEmpty(vp.getValue())){
                Element propertyElement=createPropertyElement(vp.getName(),vp.getValue());
                element.add(propertyElement);                   
            }
        }
    }
    return element;
}
项目:lams    文件:Constraint.java   
public String sqlCreateString(Dialect dialect, Mapping p, String defaultCatalog, String defaultSchema) {
    if ( isGenerated( dialect ) ) {
        // Certain dialects (ex: HANA) don't support FKs as expected, but other constraints can still be created.
        // If that's the case, hasAlterTable() will be true, but getAddForeignKeyConstraintString will return
        // empty string.  Prevent blank "alter table" statements.
        String constraintString = sqlConstraintString( dialect, getName(), defaultCatalog, defaultSchema );
        if ( !StringHelper.isEmpty( constraintString ) ) {
            StringBuilder buf = new StringBuilder( "alter table " )
                    .append( getTable().getQualifiedName( dialect, defaultCatalog, defaultSchema ) )
                    .append( constraintString );
            return buf.toString();
        }
    }
    return null;
}
项目:lams    文件:DialectFactoryImpl.java   
@Override
public Dialect buildDialect(Map configValues, DialectResolutionInfoSource resolutionInfoSource) throws HibernateException {
    final String dialectName = (String) configValues.get( AvailableSettings.DIALECT );
    if ( !StringHelper.isEmpty( dialectName ) ) {
        return constructDialect( dialectName );
    }
    else {
        return determineDialect( resolutionInfoSource );
    }
}
项目:bdf2    文件:EntityFieldManager.java   
public EntityField mapRow(ResultSet rs, int rowNum) throws SQLException {
    EntityField f=new EntityField();
    f.setId(rs.getString(1));
    f.setName(rs.getString(2));
    f.setReadOnly((rs.getString(3)==null || rs.getString(3).equals("0"))?false:true);
    f.setSubmittable((rs.getString(4)==null || rs.getString(4).equals("0"))?false:true);
    f.setDesc(rs.getString(5));
    String metaDataId=rs.getString(6);
    if(StringUtils.hasText(metaDataId)){
        f.setMetaData(metadataManager.loadMetadataById(metaDataId));
    }
    f.setEntityId(rs.getString(7));
    f.setPrimaryKey((rs.getString(8)==null || rs.getString(8).equals("0"))?false:true);
    f.setDataType(rs.getString(9));
    f.setLabel(rs.getString(10));
    f.setRequired((rs.getString(11)==null || rs.getString(11).equals("0"))?false:true);
    f.setDefaultValue(rs.getString(12));
    f.setDisplayFormat(rs.getString(13));
    if(rs.getString(14)!=null){
        f.setKeyGenerateType(KeyGenerateType.valueOf(rs.getString(14)));                
    }
    f.setKeyGenerator(rs.getString(15));
    String mappingId=rs.getString(16);
    if(StringHelper.isNotEmpty(mappingId)){
        f.setMapping(mappingManager.loadMapping(mappingId));
    }
    f.setTableName(rs.getString(17));
    return f;
}
项目:bdf2    文件:AbstractConverter.java   
private String buildLayout(ComponentInfo component){
    if(!retriveComponentSupport(component).isSupportLayout()){
        return null;
    }
    StringBuffer sb=new StringBuffer();
    if(StringHelper.isNotEmpty(component.getLayout())){
        sb.append(component.getLayout());
    }
    if(component.getLayoutProperties()!=null){
        int i=0;
        for(LayoutProperty lp:component.getLayoutProperties()){
            if(i==0){
                sb.append(" ");                 
            }
            if(StringHelper.isNotEmpty(lp.getName()) && StringHelper.isNotEmpty(lp.getValue())){
                if(i>0){
                    sb.append(";");
                }
                sb.append(lp.getName()+":"+lp.getValue());
                i++;
            }
        }
    }
    if(sb.length()>0){
        return sb.toString();
    }else{
        return null;
    }
}
项目:bdf2    文件:HtmlContainerConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=HtmlContainer.class.getSimpleName();
    XmlNode node=HtmlContainer.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    return element;
}
项目:bdf2    文件:ButtonConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,Element rootElement) throws Exception {
    String name=Button.class.getSimpleName();
    XmlNode node=Button.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    return element;
}
项目:bdf2    文件:CheckBoxConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=CheckBox.class.getSimpleName();
    XmlNode node=CheckBox.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    this.fillDataSetAndDataPathProperty(element, component,false);
    return element;
}
项目:bdf2    文件:AutoFormElementConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,Element rootElement)
        throws Exception {
    String name=AutoFormElement.class.getSimpleName();
    XmlNode node=AutoFormElement.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    boolean addProperty=true;
    for(ComponentProperty cp:component.getComponentProperties()){
        if(cp.getName().equals("property")){
            addProperty=false;
            break;
        }
    }
    if(addProperty){
        BaseElement propertyElement=new BaseElement("Property");
        propertyElement.addAttribute("name","property");
        propertyElement.setText(component.getName());
        element.add(propertyElement);
    }

    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:BindingConfigConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=BindingConfig.class.getSimpleName();
    XmlNode node=BindingConfig.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    String[] dsInfo=this.retriveDataSetAndDataPath(component);
    if(dsInfo!=null){
        String dataPath=dsInfo[1];
        int pos=dataPath.lastIndexOf(".");
        if(pos!=-1){
            dataPath=dataPath.substring(pos+1);
        }
        Element childrenPropertyElement=new BaseElement("Property");
        childrenPropertyElement.addAttribute("name", "childrenProperty");
        childrenPropertyElement.setText(dataPath);
        element.add(childrenPropertyElement);
    }
    if(component.getChildren()!=null){
        for(ComponentInfo c:component.getChildren()){
            this.buildChildren(element,c,ruleSet,rootElement);                          
        }
    }
    return element;
}
项目:bdf2    文件:ListDropDownConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=ListDropDown.class.getSimpleName();
    XmlNode node=ListDropDown.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    return element;
}
项目:bdf2    文件:HtmlEditorConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=HtmlEditor.class.getSimpleName();
    XmlNode node=HtmlEditor.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    this.fillDataSetAndDataPathProperty(element, component,false);
    return element;
}
项目:bdf2    文件:LabelConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=Label.class.getSimpleName();
    XmlNode node=Label.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    return element;
}
项目:bdf2    文件:TextAreaConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=TextArea.class.getSimpleName();
    XmlNode node=TextArea.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    this.fillDataSetAndDataPathProperty(element, component,false);
    return element;
}
项目:bdf2    文件:TriggerConverter.java   
public Element convert(ComponentInfo component, RuleSet ruleSet,
        Element rootElement) throws Exception {
    String name=Trigger.class.getSimpleName();
    XmlNode node=Trigger.class.getAnnotation(XmlNode.class);
    if(node!=null && StringHelper.isNotEmpty(node.nodeName())){
        name=node.nodeName();
    }
    Rule rule=ruleSet.getRule(name);
    BaseElement element = fillElement(component,ruleSet,rule,rootElement);
    return element;
}