本文整理汇总了Java中org.stringtemplate.v4.misc.STNoSuchPropertyException类的典型用法代码示例。如果您正苦于以下问题:Java STNoSuchPropertyException类的具体用法?Java STNoSuchPropertyException怎么用?Java STNoSuchPropertyException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
STNoSuchPropertyException类属于org.stringtemplate.v4.misc包,在下文中一共展示了STNoSuchPropertyException类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName)
throws STNoSuchPropertyException
{
JSONObject jo = (JSONObject)o;
Object value;
if (property == null || !jo.has(propertyName))
{
throw new STNoSuchPropertyException(null, null, propertyName);
}
value = jo.get(propertyName);
if (value instanceof JSONArray)
{
value = convertJSONArrayToArray((JSONArray)value);
} else if (value == JSONObject.NULL) {
value = null;
}
return value;
}
开发者ID:jsnyders,项目名称:STSTv4,代码行数:21,代码来源:STStandaloneTool.java
示例2: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public synchronized Object getProperty(Interpreter anInter, ST aSt,
Object anObject, Object aProperty, String aName)
throws STNoSuchPropertyException {
Raml oRoot=(Raml)anObject;
if(aName.equals("baseUri")) {
return Resolver.resolve(oRoot.getBaseUri(), oRoot.getBaseUriParameters(), "[BaseUriParameter]");
}
if(aName.equals("cleanVersion")) {
if(oRoot.getVersion()!=null) {
return Utils.cleanString(oRoot.getVersion());
} else {
return null;
}
}
return super.getProperty(anInter, aSt, anObject, aProperty, aName);
}
开发者ID:pagesjaunes,项目名称:raml-codegen,代码行数:18,代码来源:RamlAdaptator.java
示例3: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public synchronized Object getProperty(Interpreter anInter, ST aSt,
Object anObject, Object aProperty, String aName)
throws STNoSuchPropertyException {
MimeType oBody=(MimeType)anObject;
if(aName.equals("isSpecific")) {
return !oBody.getType().equals("*/*");
}
if(aName.equals("name")) {
return StringUtils.replaceChars(oBody.getType(), "*/", "s_");
}
if(aName.equals("schemaEscape")) {
return StringEscapeUtils.escapeJava(oBody.getSchema());
}
if(aName.equals("exampleEscape")) {
return StringEscapeUtils.escapeJava(oBody.getExample());
}
if(aName.equals("exampleEscapeJS")) {
return StringEscapeUtils.escapeEcmaScript(oBody.getExample());
}
return super.getProperty(anInter, aSt, anObject, aProperty, aName);
}
开发者ID:pagesjaunes,项目名称:raml-codegen,代码行数:23,代码来源:MimeTypeAdaptator.java
示例4: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public Object getProperty(Interpreter interpreter, ST self, Object o, Object property, String propertyName)
throws STNoSuchPropertyException {
MapLike mapLike=(MapLike) o;
return mapLike.get(propertyName).orElseNull();
// return super.getProperty(interpreter,self,o,property,propertyName);
}
开发者ID:flapdoodle-oss,项目名称:de.flapdoodle.solid,代码行数:8,代码来源:StringtemplateTheme.java
示例5: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName) throws STNoSuchPropertyException {
final Map<?, ?> map = (Map<?, ?>) o;
switch (propertyName) {
case "entrySet":
return map.entrySet();
case "hasSingleValue":
return map.size() == 1;
}
return super.getProperty(interp, self, o, property, propertyName);
}
开发者ID:nidi3,项目名称:raml-doc,代码行数:12,代码来源:EntrySetMapModelAdaptor.java
示例6: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName) throws STNoSuchPropertyException {
final SecuritySchemeDescriptor d = (SecuritySchemeDescriptor) o;
switch (propertyName) {
case "queryParameters":
return new TreeMap<>(d.getQueryParameters());
case "headers":
return new TreeMap<>(d.getHeaders());
case "responses":
return new TreeMap<>(d.getResponses());
default:
return super.getProperty(interp, self, o, property, propertyName);
}
}
开发者ID:nidi3,项目名称:raml-doc,代码行数:15,代码来源:SecuritySchemeDescriptorAdaptor.java
示例7: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName) throws STNoSuchPropertyException {
final Action a = (Action) o;
switch (propertyName) {
case "securitySchemes":
if (a.getSecuredBy() != null && !a.getSecuredBy().isEmpty()) {
return a.getSecuredBy();
}
if (a.getResource().getSecuredBy() != null && !a.getResource().getSecuredBy().isEmpty()) {
return a.getResource().getSecuredBy();
}
if (raml.getSecuredBy() != null && !raml.getSecuredBy().isEmpty()) {
return raml.getSecuredBy();
}
return Collections.emptyList();
case "type":
return a.getType().toString();
case "responses":
return new TreeMap<>(a.getResponses());
case "queryParameters":
return new TreeMap<>(a.getQueryParameters());
case "headers":
return new TreeMap<>(a.getHeaders());
case "body":
return a.getBody() == null ? null : new TreeMap<>(a.getBody());
default:
return super.getProperty(interp, self, o, property, propertyName);
}
}
开发者ID:nidi3,项目名称:raml-doc,代码行数:30,代码来源:ActionAdaptor.java
示例8: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName) throws STNoSuchPropertyException {
final Response r = (Response) o;
switch (propertyName) {
case "body":
return r.getBody() == null ? null : new TreeMap<>(r.getBody());
case "headers":
return new TreeMap<>(r.getHeaders());
default:
return super.getProperty(interp, self, o, property, propertyName);
}
}
开发者ID:nidi3,项目名称:raml-doc,代码行数:13,代码来源:ResponseAdaptor.java
示例9: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName) throws STNoSuchPropertyException {
final Resource res = (Resource) o;
switch (propertyName) {
case "resolvedUriParameters":
final Map<String, UriParameter> params = new TreeMap<>();
getAllResources(res, params);
return params;
case "actions":
return new TreeMap<>(res.getActions());
default:
return super.getProperty(interp, self, o, property, propertyName);
}
}
开发者ID:nidi3,项目名称:raml-doc,代码行数:15,代码来源:ResourceAdaptor.java
示例10: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName) throws STNoSuchPropertyException {
if ("allResources".equals(propertyName)) {
return getAllResources((Raml) o);
}
return super.getProperty(interp, self, o, property, propertyName);
}
开发者ID:nidi3,项目名称:raml-doc,代码行数:8,代码来源:RamlAdaptor.java
示例11: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public synchronized Object getProperty(Interpreter anInter, ST aSt,
Object anObject, Object aProperty, String aName)
throws STNoSuchPropertyException {
ActionType oType=(ActionType)anObject;
if(aName.equals("validation")) {
return "validation"+oType;
}
return super.getProperty(anInter, aSt, anObject, aProperty, aName);
}
开发者ID:pagesjaunes,项目名称:raml-codegen,代码行数:11,代码来源:ActionTypeAdaptator.java
示例12: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public synchronized Object getProperty(Interpreter anInter, ST aSt,
Object anObject, Object aProperty, String aName)
throws STNoSuchPropertyException {
Response oResponse=(Response)anObject;
if(aName.equals("body")) {
if(oResponse.getBody()==null || oResponse.getBody().size()==0) {
Map<String, MimeType> oMap=oResponse.getBody()==null?new HashMap<String, MimeType>():oResponse.getBody();
oMap.put("*/*", new MimeType("*/*"));
oResponse.setBody(oMap);
}
}
return super.getProperty(anInter, aSt, anObject, aProperty, aName);
}
开发者ID:pagesjaunes,项目名称:raml-codegen,代码行数:15,代码来源:ResponseAdaptator.java
示例13: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public synchronized Object getProperty(Interpreter anInter, ST aSt,
Object anObject, Object aProperty, String aName)
throws STNoSuchPropertyException {
Resource oResource=(Resource)anObject;
if(aName.startsWith("uri")) {
String oUri = oResource.getParentResource()==null?"":(String)getProperty(anInter, aSt, oResource.getParentResource(), aName, aName);
oUri += oResource.getRelativeUri();
if(aName.endsWith("express")) {
oUri=StringUtils.replace(oUri, "{mediaTypeExtension}", "");
oUri=StringUtils.replace(StringUtils.replaceChars(oUri, '{', ':'),"}", "");
}
return oUri;
}
if(aName.equals("methodUri")) {
String oReturn=Utils.cleanString(oResource.getRelativeUri());
for(Resource oR=oResource.getParentResource(); oR!=null; oR=oR.getParentResource()) {
oReturn=Utils.cleanString(oR.getRelativeUri())+"_"+oReturn;
}
return oReturn;
}
if(aName.equals("get")) {
return oResource.getAction(ActionType.GET);
}
if(aName.equals("post")) {
return oResource.getAction(ActionType.POST);
}
if(aName.equals("put")) {
return oResource.getAction(ActionType.PUT);
}
if(aName.equals("delete")) {
return oResource.getAction(ActionType.DELETE);
}
return super.getProperty(anInter, aSt, anObject, aProperty, aName);
}
开发者ID:pagesjaunes,项目名称:raml-codegen,代码行数:36,代码来源:ResourceAdaptator.java
示例14: userCodeException
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
public String userCodeException(STMessage arg) {
Throwable t = arg.cause;
if (t instanceof STNoSuchPropertyException) {
STNoSuchPropertyException exp = (STNoSuchPropertyException)t;
if (exp.getCause() != null && exp.getCause() instanceof InvocationTargetException) {
InvocationTargetException ite = (InvocationTargetException)exp.getCause();
return "User Code Exception: " + ite.getCause();
}
}
return "<Unknown>";
}
开发者ID:smaccm,项目名称:smaccm,代码行数:12,代码来源:TbSTErrorListener.java
示例15: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
@Override
public final Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName) throws STNoSuchPropertyException {
Preconditions.checkArgument(type.isInstance(o),"instance %s is not of type %s",o,type);
return getProperty((T) o, propertyName);
}
开发者ID:flapdoodle-oss,项目名称:de.flapdoodle.solid,代码行数:6,代码来源:TypesafeModelAdapter.java
示例16: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
/**
* Lookup property name in {@code o} and return its value.
* <p>
* {@code property} is normally a {@code String} but doesn't have to be.
* E.g., if {@code o} is {@link Map}, {@code property} could be
* any key type. If we need to convert to {@code String}, then it's done by
* {@code ST} and passed in here.</p>
*/
Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName) throws STNoSuchPropertyException;
开发者ID:antlr,项目名称:codebuff,代码行数:10,代码来源:ModelAdaptor.java
示例17: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
/**
* Lookup property name in {@code o} and return its value.
* <p>
* {@code property} is normally a {@code String} but doesn't have to be.
* E.g., if {@code o} is {@link Map}, {@code property} could be
* any key type. If we need to convert to {@code String}, then it's done by
* {@code ST} and passed in here.</p>
*/
Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName)throws STNoSuchPropertyException;
开发者ID:antlr,项目名称:codebuff,代码行数:10,代码来源:ModelAdaptor.java
示例18: getProperty
import org.stringtemplate.v4.misc.STNoSuchPropertyException; //导入依赖的package包/类
/**
* Lookup property name in {@code o} and return its value.
* <p>
* {@code property} is normally a {@code String} but doesn't have to be.
* E.g., if {@code o} is {@link Map}, {@code property} could be
* any key type. If we need to convert to {@code String}, then it's done by
* {@code ST} and passed in here.</p>
*/
Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName)
throws STNoSuchPropertyException;
开发者ID:antlr,项目名称:codebuff,代码行数:11,代码来源:ModelAdaptor.java
注:本文中的org.stringtemplate.v4.misc.STNoSuchPropertyException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论