/** * Check if class is a simple value type. * * @param clas * @return simple value type flag */ private boolean isSimpleValue(IClass clas) { return Types.isSimpleValue(clas.getName()); }
/** * Check if type is a collection type (specifically collection, not array). * * @param type * @return item type, <code>null</code> if not a collection type */ private boolean isCollection(String type, IClassLocator icl) { IClass info = icl.getRequiredClassInfo(type); return info.isImplements("Ljava/util/Collection;"); }
/** * Check if class is an enumeration type. * * @param clas * @return enumeration type flag */ private boolean isEnumeration(IClass clas) { return clas.isSuperclass("java.lang.Enum"); }
String string = "Hello World"; StringStack stack = new StringStack(string); char c = stack.pop(); String remnant = stack.toString(); // ...
LazyList ll = new LazyList(); // Add a couple million objects ll.multiplyList(2);
/** * Constructor. * * @param parent parent */ public NestingCustomBase(NestingCustomBase parent) { super(parent); m_children = new LazyList(); }
/** * Check if this is a directly instantiable class (not an interface, and not abstract) * * @return <code>true</code> if instantiable, <code>false</code> if not */ public boolean isConcreteClass() { return !(m_classInformation.isAbstract() || m_classInformation.isInterface()); }
/** * Create a unique prefix. If the requested prefix is already in use, this modifies the prefix by appending a * numeric suffix to create a unique variant. * * @param pref requested prefix * @param prefixes prefixes in use * @return unique prefix */ private String makeUniquePrefix(String pref, StringSizedSet prefixes) { int loop = 0; while (prefixes.contains(pref)) { pref = pref + loop; } prefixes.add(pref); return pref; }
protected Map applyOverrides(Map overmap) { return ReflectionUtilities.applyKeyValueMap(overmap, m_customRoot); } }
/** * Convert singular name to plural form. * * @param name base name * @return plural name */ public String pluralize(String name) { return NameUtilities.pluralize(name); }
/** * Get customization information for a member by name. This method may only be called after * {@link #apply(IClassLocator)}. * * @param name Member name * @return customization, or <code>null</code> if none */ public ValueCustom getMember(String name) { return (ValueCustom)m_memberMap.get(name); }
/** * Get class information. * * @param type fully-qualified class name * @return information, or <code>null</code> if unable to load */ public IClass getClassInfo(String type) { return m_classLocator.getClassInfo(type); }
/** * Get collection of members in class. * * @return members */ public Collection getMembers() { return m_memberMap.values(); } }
/** * Convert potentially plural name to singular form. * * @param name base name * @return singularized name */ public String depluralize(String name) { return NameUtilities.depluralize(name); }
/** * Match class name against pattern. * * @param name * @return <code>true</code> if name matches pattern, <code>false</code> if not */ protected boolean matchName(String name) { if (m_matchName != null) { return NameUtilities.isPatternMatch(name, m_matchName); } return true; } }
/** * Get formatted documentation from class item, in the form of a list of <code>org.w3c.dom.Node</code> instances. * * @param info item information * @return formatted documentation (<code>null</code> if none) */ public List getItemDocumentation(IClassItem info) { return docToNodes(info.getJavaDoc()); } }
/** * Constructor from message name and singleton part. * * @param name message name * @param tns target namespace */ public Message(String name, String tns) { m_name = name; m_qName = new QName(tns, name); m_parts = new LazyList(); }
protected Map applyOverrides(Map overmap) { return ReflectionUtilities.applyKeyValueMap(overmap, m_customRoot); }
protected Map applyOverrides(Map overmap) { Map unknowns = ReflectionUtilities.applyKeyValueMap(overmap, m_global); m_global.initClasses(); m_global.fillClasses(); return unknowns; }