本文整理汇总了Java中org.hibernate.annotations.common.util.StringHelper类的典型用法代码示例。如果您正苦于以下问题:Java StringHelper类的具体用法?Java StringHelper怎么用?Java StringHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringHelper类属于org.hibernate.annotations.common.util包,在下文中一共展示了StringHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getQueryHintString
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
@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;
}
示例2: fillDataSetAndDataPathProperty
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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);
}
}
}
示例3: buildLayoutContraint
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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;
}
}
示例4: getTopEntity
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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);
}
}
示例5: convert
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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;
}
示例6: convert
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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;
}
示例7: convert
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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;
}
示例8: convert
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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;
}
示例9: convert
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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;
}
示例10: convert
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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;
}
示例11: convert
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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;
}
示例12: convert
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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;
}
示例13: convert
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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;
}
示例14: convert
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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;
}
示例15: convert
import org.hibernate.annotations.common.util.StringHelper; //导入依赖的package包/类
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;
}