private String getEndIndentionWithReturn(int n) { return getEol() + getIndention(n) + "}"; }
private String reformatIndent(String input, int startIndent) { String ret = ""; BufferedReader reader = new BufferedReader(new StringReader(input)); try { String oneLine; while ((oneLine = reader.readLine()) != null) { ret = ret + getIndention(startIndent) + oneLine + getEol(); } } catch (IOException e) { LOG.log(Level.WARNING, "reformatIndent failed.", e); } return ret; }
private String reformatIndent(String input, int startIndent) { String ret = ""; BufferedReader reader = new BufferedReader(new StringReader(input)); try { String oneLine; while ((oneLine = reader.readLine()) != null) { ret = ret + getIndention(startIndent) + oneLine + getEol(); } } catch (IOException e) { LOG.log(Level.WARNING, "reformatIndent failed.", e); } return ret; }
private String getBeginIndentionWithReturnForList(int n) { return "[" + getEol() + getIndention(n); }
private String getEndIndentionWithReturnForList(int n) { return getEol() + getIndention(n) + "]"; }
private String getBeginIndentionWithReturn(int n) { return "{" + getEol() + getIndention(n); }
private String getBeginIndentionWithReturn(int n) { return "{" + getEol() + getIndention(n); }
private String getBeginIndentionWithReturnForList(int n) { return "[" + getEol() + getIndention(n); }
private String getEndIndentionWithReturnForList(int n) { return getEol() + getIndention(n) + "]"; }
private String getEndIndentionWithReturn(int n) { return getEol() + getIndention(n) + "}"; }
ret = ret + getBeginIndentionWithReturn(1) + "\"" + "definitions" + "\" " + " : {" + getEol(); for (Class<?> cls : resourceTypes) { if (cls.getName().endsWith(clsName) && JsonSchemaLookup.getSingleton().getSchemaForClass(cls).length() > 0) { ret = ret + getIndention(2) + "\"" + cls.getName() + "\" : " + getEol(); ret = ret + getEol(); ret = ret + getBeginIndentionWithReturn(1) + "\"" + "definitions" + "\" " + " : {" + getEol(); for (BindingOperationInfo boi : bindingInfo.getOperations()) { if (partClass != null && partClass.getName().endsWith(clsName)) { ret = ret + getIndention(2) + "\"" + partClass.getName() + "\" : " + getEol(); if (partClass != null && partClass.getName().endsWith(clsName)) { ret = ret + getIndention(2) + "\"" + partClass.getName() + "\" : " + getEol();
ret = ret + getBeginIndentionWithReturn(1) + "\"" + "definitions" + "\" " + " : {" + getEol(); for (Class<?> cls : resourceTypes) { if (cls.getName().endsWith(clsName) && JsonSchemaLookup.getSingleton().getSchemaForClass(cls).length() > 0) { ret = ret + getIndention(2) + "\"" + cls.getName() + "\" : " + getEol(); ret = ret + getEol(); ret = ret + getBeginIndentionWithReturn(1) + "\"" + "definitions" + "\" " + " : {" + getEol(); for (BindingOperationInfo boi : bindingInfo.getOperations()) { if (partClass != null && partClass.getName().endsWith(clsName)) { ret = ret + getIndention(2) + "\"" + partClass.getName() + "\" : " + getEol(); if (partClass != null && partClass.getName().endsWith(clsName)) { ret = ret + getIndention(2) + "\"" + partClass.getName() + "\" : " + getEol();
ret = ret + getBeginIndentionWithReturn(1) + "\"" + "definitions" + "\" " + " : {" + getEol(); for (Class<?> cls : resourceTypes) { if (JsonSchemaLookup.getSingleton() .getSchemaForClass(cls).length() > 0) { ret = ret + getIndention(2) + "\"" + cls.getName() + "\" : " + getEol(); .getSchemaForClass(cls), 3)) + "," + getEol(); ret = ret + "\"input\" : " + getBeginIndentionWithReturn(4) + "\"type\" : \"" + boi.getOperationInfo().getInput().getName().getLocalPart() + "\"" + getEndIndentionWithReturn(3) + "," + getEol(); ret = rollbackColon(rollbackEol(ret)) + getEndIndentionWithReturn(2) + "," + getEol(); ret = ret + getEol() + getIndention(1) + "\"definitions\" : " + getBeginIndentionWithReturn(0); for (BindingOperationInfo boi : bindingInfo.getOperations()) { ret = ret + rollbackEol(reformatIndent(JsonSchemaLookup.getSingleton() .getSchemaForClass(partClass), 3)) + "," + getEol(); + "," + getEol(); addedType.add(boi.getOperationInfo().getInput().getName().getLocalPart()); ret = ret
ret = ret + getBeginIndentionWithReturn(1) + "\"" + "definitions" + "\" " + " : {" + getEol(); for (Class<?> cls : resourceTypes) { if (JsonSchemaLookup.getSingleton() .getSchemaForClass(cls).length() > 0) { ret = ret + getIndention(2) + "\"" + cls.getName() + "\" : " + getEol(); .getSchemaForClass(cls), 3)) + "," + getEol(); ret = ret + "\"input\" : " + getBeginIndentionWithReturn(4) + "\"type\" : \"" + boi.getOperationInfo().getInput().getName().getLocalPart() + "\"" + getEndIndentionWithReturn(3) + "," + getEol(); ret = rollbackColon(rollbackEol(ret)) + getEndIndentionWithReturn(2) + "," + getEol(); ret = ret + getEol() + getIndention(1) + "\"definitions\" : " + getBeginIndentionWithReturn(0); for (BindingOperationInfo boi : bindingInfo.getOperations()) { ret = ret + rollbackEol(reformatIndent(JsonSchemaLookup.getSingleton() .getSchemaForClass(partClass), 3)) + "," + getEol(); + "," + getEol(); addedType.add(boi.getOperationInfo().getInput().getName().getLocalPart()); ret = ret
ret = ret + "\"input\" : " + getBeginIndentionWithReturn(4) + "\"type\" : \"" + boi.getOperationInfo().getInput().getName().getLocalPart() + "\"" + getEndIndentionWithReturn(2) + "," + getEol(); ret = ret + getEol() + getIndention(1) + "\"definitions\" : " + getBeginIndentionWithReturn(2); if (boi.getInput() != null && boi.getInput().getMessageParts() != null) { ret = ret + rollbackEol(reformatIndent(JsonSchemaLookup.getSingleton() .getSchemaForClass(partClass), 3)) + "," + getEol(); + "," + getEol(); ret = ret + rollbackEol(reformatIndent(JsonSchemaLookup.getSingleton() .getSchemaForClass(partClass), 3)) + "," + getEol();
ret = ret + "\"input\" : " + getBeginIndentionWithReturn(4) + "\"type\" : \"" + boi.getOperationInfo().getInput().getName().getLocalPart() + "\"" + getEndIndentionWithReturn(2) + "," + getEol(); ret = ret + getEol() + getIndention(1) + "\"definitions\" : " + getBeginIndentionWithReturn(2); if (boi.getInput() != null && boi.getInput().getMessageParts() != null) { ret = ret + rollbackEol(reformatIndent(JsonSchemaLookup.getSingleton() .getSchemaForClass(partClass), 3)) + "," + getEol(); + "," + getEol(); ret = ret + rollbackEol(reformatIndent(JsonSchemaLookup.getSingleton() .getSchemaForClass(partClass), 3)) + "," + getEol();