code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
private JsonNode invokeCallbackMethod(final InvokeRequest req, final String cookie) {
Object obj = this.getObject(req.getObjref());
Method method = this.findCallbackMethod(obj.getClass(), cookie);
final Class<?>[] argTypes = method.getParameterTypes();
final Object[] args = new Object[a... | java |
private Object invokeMethod(final Object obj, final Method method, final Object... args) {
// turn method to accessible. otherwise, we won't be able to callback to methods
// on non-public classes.
boolean accessibility = method.isAccessible();
method.setAccessible(true);
try {
... | java |
private void processCallback(final Callback callback) {
try {
JsonNode result = handleCallback(callback);
this.getClient().completeCallback(callback, null, result);
} catch (JsiiException e) {
this.getClient().completeCallback(callback, e.getMessage(), null);
... | java |
private Method findCallbackMethod(final Class<?> klass, final String signature) {
for (Method method : klass.getMethods()) {
if (method.toString().equals(signature)) {
// found!
return method;
}
}
throw new JsiiException("Unable to find c... | java |
private static Collection<JsiiOverride> discoverOverrides(final Class<?> classToInspect) {
Map<String, JsiiOverride> overrides = new HashMap<>();
Class<?> klass = classToInspect;
// if we reached a generated jsii class or Object, we should stop collecting those overrides since
// all t... | java |
static Jsii tryGetJsiiAnnotation(final Class<?> type, final boolean inherited) {
Jsii[] ann;
if (inherited) {
ann = (Jsii[]) type.getAnnotationsByType(Jsii.class);
} else {
ann = (Jsii[]) type.getDeclaredAnnotationsByType(Jsii.class);
}
if (ann.length ==... | java |
String loadModuleForClass(Class<?> nativeClass) {
final Jsii jsii = tryGetJsiiAnnotation(nativeClass, true);
if (jsii == null) {
throw new JsiiException("Unable to find @Jsii annotation for class");
}
this.loadModule(jsii.module());
return jsii.fqn();
} | java |
static String readString(final InputStream is) {
try (final Scanner s = new Scanner(is, "UTF-8")) {
s.useDelimiter("\\A");
if (s.hasNext()) {
return s.next();
} else {
return "";
}
}
} | java |
static String extractResource(final Class<?> klass, final String resourceName, final String outputDirectory) throws IOException {
String directory = outputDirectory;
if (directory == null) {
directory = Files.createTempDirectory("jsii-java-runtime-resource").toString();
}
Pa... | java |
@Nullable
protected final <T> T jsiiCall(final String method, final Class<T> returnType, @Nullable final Object... args) {
return JsiiObjectMapper.treeToValue(JsiiObject.engine.getClient()
.callMethod(this.objRef,
... | java |
@Nullable
protected static <T> T jsiiStaticCall(final Class<?> nativeClass, final String method, final Class<T> returnType, @Nullable final Object... args) {
String fqn = engine.loadModuleForClass(nativeClass);
return JsiiObjectMapper.treeToValue(engine.getClient()
... | java |
@Nullable
protected final <T> T jsiiAsyncCall(final String method, final Class<T> returnType, @Nullable final Object... args) {
JsiiClient client = engine.getClient();
JsiiPromise promise = client.beginAsyncMethod(this.objRef, method, JsiiObjectMapper.valueToTree(args));
engine.processAllPe... | java |
@Nullable
protected final <T> T jsiiGet(final String property, final Class<T> type) {
return JsiiObjectMapper.treeToValue(engine.getClient().getPropertyValue(this.objRef, property), type);
} | java |
@Nullable
protected static <T> T jsiiStaticGet(final Class<?> nativeClass, final String property, final Class<T> type) {
String fqn = engine.loadModuleForClass(nativeClass);
return JsiiObjectMapper.treeToValue(engine.getClient().getStaticPropertyValue(fqn, property), type);
} | java |
protected final void jsiiSet(final String property, @Nullable final Object value) {
engine.getClient().setPropertyValue(this.objRef, property, JsiiObjectMapper.valueToTree(value));
} | java |
protected static void jsiiStaticSet(final Class<?> nativeClass, final String property, @Nullable final Object value) {
String fqn = engine.loadModuleForClass(nativeClass);
engine.getClient().setStaticPropertyValue(fqn, property, JsiiObjectMapper.valueToTree(value));
} | java |
@RequiresPermission(Manifest.permission.BLUETOOTH)
static void checkAdapterStateOn(@Nullable final BluetoothAdapter adapter) {
if (adapter == null || adapter.getState() != BluetoothAdapter.STATE_ON) {
throw new IllegalStateException("BT Adapter is not turned ON");
}
} | java |
private static boolean matchesServiceUuid(@NonNull final UUID uuid,
@Nullable final UUID mask,
@NonNull final UUID data) {
if (mask == null) {
return uuid.equals(data);
}
if ((uuid.getLeastSignificantBits() & mask.getLeastSignificantBits()) !=
(data.getLeastSignificantBits() & m... | java |
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
private boolean matchesPartialData(@Nullable final byte[] data,
@Nullable final byte[] dataMask,
@Nullable final byte[] parsedData) {
if (data == null) {
// If filter data is null it means it doesn't matter.
// We return true if any dat... | java |
@NonNull
public synchronized static BluetoothLeScannerCompat getScanner() {
if (instance != null)
return instance;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
return instance = new BluetoothLeScannerImplOreo();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
return instance = new BluetoothLe... | java |
private void setPowerSaveSettings() {
long minRest = Long.MAX_VALUE, minScan = Long.MAX_VALUE;
synchronized (wrappers) {
for (final ScanCallbackWrapper wrapper : wrappers.values()) {
final ScanSettings settings = wrapper.scanSettings;
if (settings.hasPowerSaveMode()) {
if (minRest > settings.getPowe... | java |
public void setCode(ExprCode code) {
mCode = code;
mStartPos = mCode.mStartPos;
mCurIndex = mStartPos;
} | java |
public static boolean isRtl() {
if (sEnable && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
return View.LAYOUT_DIRECTION_RTL == TextUtils.getLayoutDirectionFromLocale(Locale.getDefault());
}
return false;
} | java |
public static int getRealLeft(boolean isRtl, int parentLeft, int parentWidth, int left, int width) {
if (isRtl) {
// 1, trim the parent's left.
left -= parentLeft;
// 2, calculate the RTL left.
left = parentWidth - width - left;
// 3, add the parent's ... | java |
public static ViewServer get(Context context) {
ApplicationInfo info = context.getApplicationInfo();
if (BUILD_TYPE_USER.equals(Build.TYPE) &&
(info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
if (sServer == null) {
sServer = new ViewServer(ViewServer.VIE... | java |
public void removeWindow(View view) {
mWindowsLock.writeLock().lock();
try {
mWindows.remove(view.getRootView());
} finally {
mWindowsLock.writeLock().unlock();
}
fireWindowsChangedEvent();
} | java |
public void setFocusedWindow(View view) {
mFocusLock.writeLock().lock();
try {
mFocusedWindow = view == null ? null : view.getRootView();
} finally {
mFocusLock.writeLock().unlock();
}
fireFocusChangedEvent();
} | java |
public void run() {
try {
mServer = new ServerSocket(mPort, VIEW_SERVER_MAX_CONNECTIONS, InetAddress.getLocalHost());
} catch (Exception e) {
Log.w(LOG_TAG, "Starting ServerSocket error: ", e);
}
while (mServer != null && Thread.currentThread() == mThread) {
... | java |
public static String removeQueryParameter(String url, String key) {
String[] urlParts = url.split("\\?");
if (urlParts.length == 2) {
Map<String, List<String>> paramMap = extractParametersFromQueryString(urlParts[1]);
if (paramMap.containsKey(key)) {
String queryValue = paramMap.get(key).ge... | java |
protected void verifyParameterLegality(Parameter... parameters) {
for (Parameter parameter : parameters)
if (illegalParamNames.contains(parameter.name)) {
throw new IllegalArgumentException(
"Parameter '" + parameter.name + "' is reserved for RestFB use - you cannot specify it yourself... | java |
public <T extends BaseNlpEntity> List<T> getEntities(Class<T> clazz) {
List<BaseNlpEntity> resultList = new ArrayList<>();
for (BaseNlpEntity item : getEntities()) {
if (item.getClass().equals(clazz)) {
resultList.add(item);
}
}
return (List<T>) resultList;
} | java |
private void fillOrder(JsonObject summary) {
if (summary != null) {
order = summary.getString("order", order);
}
if (order == null && openGraphCommentOrder != null) {
order = openGraphCommentOrder;
}
} | java |
private void fillCanComment(JsonObject summary) {
if (summary != null && summary.get("can_comment") != null) {
canComment = summary.get("can_comment").asBoolean();
}
if (canComment == null && openGraphCanComment != null) {
canComment = openGraphCanComment;
}
} | java |
public static byte[] decodeBase64(String base64) {
if (base64 == null)
throw new NullPointerException("Parameter 'base64' cannot be null.");
String fixedBase64 = padBase64(base64);
return Base64.getDecoder().decode(fixedBase64);
} | java |
public static String encodeAppSecretProof(String appSecret, String accessToken) {
try {
byte[] key = appSecret.getBytes(StandardCharsets.UTF_8);
SecretKeySpec signingKey = new SecretKeySpec(key, "HmacSHA256");
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(signingKey);
byte[] raw = ... | java |
public JsonObject remove(String name) {
if (name == null) {
throw new NullPointerException(NAME_IS_NULL);
}
int index = indexOf(name);
if (index != -1) {
table.remove(index);
names.remove(index);
values.remove(index);
}
return this;
} | java |
public JsonObject merge(JsonObject object) {
if (object == null) {
throw new NullPointerException(OBJECT_IS_NULL);
}
for (Member member : object) {
this.set(member.name, member.value);
}
return this;
} | java |
protected String urlDecodeSignedRequestToken(String signedRequestToken) {
verifyParameterPresence("signedRequestToken", signedRequestToken);
return signedRequestToken.replace("-", "+").replace("_", "/").trim();
} | java |
protected boolean verifySignedRequest(String appSecret, String algorithm, String encodedPayload, byte[] signature) {
verifyParameterPresence("appSecret", appSecret);
verifyParameterPresence("algorithm", algorithm);
verifyParameterPresence("encodedPayload", encodedPayload);
verifyParameterPresence("signa... | java |
protected String toParameterString(boolean withJsonParameter, Parameter... parameters) {
if (!isBlank(accessToken)) {
parameters = parametersWithAdditionalParameter(Parameter.with(ACCESS_TOKEN_PARAM_NAME, accessToken), parameters);
}
if (!isBlank(accessToken) && !isBlank(appSecret)) {
parameter... | java |
protected String getFacebookGraphEndpointUrl() {
if (apiVersion.isUrlElementRequired()) {
return getFacebookEndpointUrls().getGraphEndpoint() + '/' + apiVersion.getUrlElement();
} else {
return getFacebookEndpointUrls().getGraphEndpoint();
}
} | java |
protected String getFacebookGraphVideoEndpointUrl() {
if (apiVersion.isUrlElementRequired()) {
return getFacebookEndpointUrls().getGraphVideoEndpoint() + '/' + apiVersion.getUrlElement();
} else {
return getFacebookEndpointUrls().getGraphVideoEndpoint();
}
} | java |
public Double getDoubleFrom(JsonValue json) {
if (json.isNumber()) {
return json.asDouble();
} else {
return Double.valueOf(json.asString());
}
} | java |
public Integer getIntegerFrom(JsonValue json) {
if (json.isNumber()) {
return json.asInt();
} else {
return Integer.valueOf(json.asString());
}
} | java |
public String getStringFrom(JsonValue json) {
if (json.isString()) {
return json.asString();
} else {
return json.toString();
}
} | java |
public Float getFloatFrom(JsonValue json) {
if (json.isNumber()) {
return json.asFloat();
} else {
return new BigDecimal(json.asString()).floatValue();
}
} | java |
public BigInteger getBigIntegerFrom(JsonValue json) {
if (json.isString()) {
return new BigInteger(json.asString());
} else {
return new BigInteger(json.toString());
}
} | java |
public Long getLongFrom(JsonValue json) {
if (json.isNumber()) {
return json.asLong();
} else {
return Long.valueOf(json.asString());
}
} | java |
public BigDecimal getBigDecimalFrom(JsonValue json) {
if (json.isString()) {
return new BigDecimal(json.asString());
} else {
return new BigDecimal(json.toString());
}
} | java |
private void fillTotalCount(JsonObject summary) {
if (totalCount == 0 && summary != null && summary.get("total_count") != null) {
totalCount = summary.getLong("total_count", totalCount);
}
} | java |
protected String createFormFieldName(BinaryAttachment binaryAttachment) {
if (binaryAttachment.getFieldName() != null) {
return binaryAttachment.getFieldName();
}
String name = binaryAttachment.getFilename();
int fileExtensionIndex = name.lastIndexOf('.');
return fileExtensionIndex > 0 ? name... | java |
public InnerMessagingItem getItem() {
if (optin != null) {
return optin;
}
if (postback != null) {
return postback;
}
if (delivery != null) {
return delivery;
}
if (read != null) {
return read;
}
if (accountLinking != null) {
return accountLinking;
... | java |
public List<String> getRoles(String appId) {
if (roles.containsKey(appId)) {
return Collections.unmodifiableList(roles.get(appId));
} else {
return null;
}
} | java |
protected void skipResponseStatusExceptionParsing(String json) throws ResponseErrorJsonParsingException {
// If this is not an object, it's not an error response.
if (!json.startsWith("{")) {
throw new ResponseErrorJsonParsingException();
}
int subStrEnd = Math.min(50, json.length());
if (!js... | java |
public InputStream getData() {
if (data != null) {
return new ByteArrayInputStream(data);
} else if (dataStream != null) {
return dataStream;
} else {
throw new IllegalStateException("Either the byte[] or the stream mustn't be null at this point.");
}
} | java |
public String getContentType() {
if (contentType != null) {
return contentType;
}
if (dataStream != null) {
try {
contentType = URLConnection.guessContentTypeFromStream(dataStream);
} catch (IOException ioe) {
// ignore exception
}
}
if (data != null) {
... | java |
protected void logMultipleMappingFailedForField(String facebookFieldName,
FieldWithAnnotation<Facebook> fieldWithAnnotation, String json) {
if (!MAPPER_LOGGER.isTraceEnabled()) {
return;
}
Field field = fieldWithAnnotation.getField();
MAPPER_LOGGER.trace(
"Could not map '{}' to {}. {... | java |
protected Set<String> facebookFieldNamesWithMultipleMappings(
List<FieldWithAnnotation<Facebook>> fieldsWithAnnotation) {
Map<String, Integer> facebookFieldsNamesWithOccurrenceCount = new HashMap<>();
Set<String> facebookFieldNamesWithMultipleMappings = new HashSet<>();
// Get a count of Facebook fie... | java |
public static boolean isEmptyCollectionOrMap(Object obj) {
if (obj instanceof Collection) {
return ((Collection) obj).isEmpty();
}
return (obj instanceof Map && ((Map) obj).isEmpty());
} | java |
public static RestFBLogger getLoggerInstance(String logCategory) {
Object obj;
Class[] ctrTypes = new Class[] { String.class };
Object[] ctrArgs = new Object[] { logCategory };
try {
Constructor loggerClassConstructor = usedLoggerClass.getConstructor(ctrTypes);
obj = loggerClassConstructor.n... | java |
static int limitedCompare(CharSequence left, CharSequence right, final boolean caseSensitive, final int threshold) { // NOPMD
if (left == null || right == null) {
throw new IllegalArgumentException("Strings must not be null");
}
if (threshold < 0) {
throw new IllegalArgumentException("Threshold must not be ... | java |
private void updateList(final File filename) {
try {
final URI reletivePath = toURI(filename.getAbsolutePath().substring(new File(normalize(tempDir.toString())).getPath().length() + 1));
final FileInfo f = job.getOrCreateFileInfo(reletivePath);
if (hasConref) {
... | java |
public void addPlugins(final String s) {
final StringTokenizer t = new StringTokenizer(s, REQUIREMENT_SEPARATOR);
while (t.hasMoreTokens()) {
plugins.add(t.nextToken());
}
} | java |
private void refineAction(final Action action, final FilterKey key) {
if (key.value != null && bindingMap != null && !bindingMap.isEmpty()) {
final Map<String, Set<Element>> schemeMap = bindingMap.get(key.attribute);
if (schemeMap != null && !schemeMap.isEmpty()) {
for (f... | java |
private void insertAction(final Element subTree, final QName attName, final Action action) {
if (subTree == null || action == null) {
return;
}
final LinkedList<Element> queue = new LinkedList<>();
// Skip the sub-tree root because it has been added already.
NodeLis... | java |
private Element searchForKey(final Element root, final String keyValue) {
if (root == null || keyValue == null) {
return null;
}
final LinkedList<Element> queue = new LinkedList<>();
queue.add(root);
while (!queue.isEmpty()) {
final Element node = queue.re... | java |
private void insertAction(final Action action, final FilterKey key) {
if (filterMap.get(key) == null) {
filterMap.put(key, action);
} else {
logger.info(MessageUtils.getMessage("DOTJ007I", key.toString()).toString());
}
} | java |
private void outputSubjectScheme() throws DITAOTException {
try {
final Map<URI, Set<URI>> graph = SubjectSchemeReader.readMapFromXML(new File(job.tempDir, FILE_NAME_SUBJECT_RELATION));
final Queue<URI> queue = new LinkedList<>(graph.keySet());
final Set<URI> visitedSet = ne... | java |
private void generateScheme(final File filename, final Document root) throws DITAOTException {
final File p = filename.getParentFile();
if (!p.exists() && !p.mkdirs()) {
throw new DITAOTException("Failed to make directory " + p.getAbsolutePath());
}
Result res = null;
... | java |
public static File getPathtoProject(final File filename, final File traceFilename, final File inputMap, final Job job) {
if (job.getGeneratecopyouter() != Job.Generate.OLDSOLUTION) {
if (isOutFile(traceFilename, inputMap)) {
return toFile(getRelativePathFromOut(traceFilename.getAbsol... | java |
private static String getRelativePathFromOut(final File overflowingFile, final Job job) {
final URI relativePath = URLUtils.getRelativePath(job.getInputFile(), overflowingFile.toURI());
final File outputDir = job.getOutputDir().getAbsoluteFile();
final File outputPathName = new File(outputDir, "... | java |
@Override
public AbstractPipelineOutput execute(final AbstractPipelineInput input) throws DITAOTException {
final Collection<FileInfo> fis = job.getFileInfo(fi -> fi.isInput);
if (!fis.isEmpty()) {
final Map<URI, Map<String, Element>> mapSet = getMapMetadata(fis);
pushMetadat... | java |
private void pushMetadata(final Map<URI, Map<String, Element>> mapSet) {
if (!mapSet.isEmpty()) {
//process map first
final DitaMapMetaWriter mapInserter = new DitaMapMetaWriter();
mapInserter.setLogger(logger);
mapInserter.setJob(job);
for (final Entr... | java |
private Map<URI, Map<String, Element>> getMapMetadata(final Collection<FileInfo> fis) {
final MapMetaReader metaReader = new MapMetaReader();
metaReader.setLogger(logger);
metaReader.setJob(job);
for (final FileInfo f : fis) {
final File mapFile = new File(job.tempDir, f.file... | java |
private URI getRelativePath(final URI href) {
final URI keyValue;
final URI inputMap = job.getFileInfo(fi -> fi.isInput).stream()
.map(fi -> fi.uri)
.findFirst()
.orElse(null);
if (inputMap != null) {
final URI tmpMap = job.tempDirURI.r... | java |
private void setActiveProjectProperty(final String propertyName, final String propertyValue) {
final Project activeProject = getProject();
if (activeProject != null) {
activeProject.setProperty(propertyName, propertyValue);
}
} | java |
private String[] readParamValues() throws BuildException {
final ArrayList<String> prop = new ArrayList<>();
for (final ParamElem p : params) {
if (!p.isValid()) {
throw new BuildException("Incomplete parameter");
}
if (isValid(getProject(), getLocatio... | java |
@Override
public String getIndexFileName(final String outputFileRoot) {
final File indexDir = new File(outputFileRoot).getParentFile();
setFilePath(indexDir.getAbsolutePath());
return new File(indexDir, "index.xml").getAbsolutePath();
} | java |
@Deprecated
public void setDitadir(final File ditaDir) {
if (!ditaDir.isAbsolute()) {
throw new IllegalArgumentException("ditadir attribute value must be an absolute path: " + ditaDir);
}
this.ditaDir = ditaDir;
} | java |
private Element getTopicDoc(final URI absolutePathToFile) {
final DocumentBuilder builder = getDocumentBuilder();
try {
final Document doc = builder.parse(absolutePathToFile.toString());
return doc.getDocumentElement();
} catch (final SAXException | IOException e) {
... | java |
public void addSubTerm(final IndexTerm term) {
int i = 0;
final int subTermNum = subTerms.size();
if (IndexTermPrefix.SEE != term.getTermPrefix() && IndexTermPrefix.SEE_ALSO != term.getTermPrefix()) {
//if the term is not "index-see" or "index-see-also"
leaf = false;
... | java |
public void addSubTerms(final List<IndexTerm> terms) {
int subTermsNum;
if (terms == null) {
return;
}
subTermsNum = terms.size();
for (int i = 0; i < subTermsNum; i++) {
addSubTerm(terms.get(i));
}
} | java |
public void sortSubTerms() {
final int subTermNum = subTerms.size();
if (subTerms != null && subTermNum > 0) {
Collections.sort(subTerms);
for (final IndexTerm subTerm : subTerms) {
subTerm.sortSubTerms();
}
}
} | java |
@Override
public int compareTo(final IndexTerm obj) {
return DITAOTCollator.getInstance(termLocale).compare(termKey, obj.getTermKey());
} | java |
public void addTargets(final List<IndexTermTarget> targets) {
int targetNum;
if (targets == null) {
return;
}
targetNum = targets.size();
for (int i = 0; i < targetNum; i++) {
addTarget(targets.get(i));
}
} | java |
public String getTermFullName() {
if (termPrefix == null) {
return termName;
} else {
if (termLocale == null) {
return termPrefix.message + STRING_BLANK + termName;
} else {
final String key = "IndexTerm." + termPrefix.message.toLowerCa... | java |
public void updateSubTerm() {
if (subTerms.size() == 1) {
// if there is only one subterm, it is necessary to update
final IndexTerm term = subTerms.get(0); // get the only subterm
if (term.getTermPrefix() == IndexTermPrefix.SEE) {
//if the only subterm is ind... | java |
public void read(final URI filename, final Document doc) {
currentFile = filename;
rootScope = null;
// TODO: use KeyScope implementation that retains order
KeyScope keyScope = readScopes(doc);
keyScope = cascadeChildKeys(keyScope);
// TODO: determine effective key defini... | java |
private KeyScope readScopes(final Document doc) {
final List<KeyScope> scopes = readScopes(doc.getDocumentElement());
if (scopes.size() == 1 && scopes.get(0).name == null) {
return scopes.get(0);
} else {
return new KeyScope("#root", null, Collections.emptyMap(), scopes);... | java |
private void readScope(final Element scope, final Map<String, KeyDef> keyDefs) {
final List<Element> maps = new ArrayList<>();
maps.add(scope);
for (final Element child: getChildElements(scope)) {
collectMaps(child, maps);
}
for (final Element map: maps) {
... | java |
private void readMap(final Element map, final Map<String, KeyDef> keyDefs) {
readKeyDefinition(map, keyDefs);
for (final Element elem: getChildElements(map)) {
if (!(SUBMAP.matches(elem) || elem.getAttributeNode(ATTRIBUTE_NAME_KEYSCOPE) != null)) {
readMap(elem, keyDefs);
... | java |
private KeyScope cascadeChildKeys(final KeyScope rootScope) {
final Map<String, KeyDef> res = new HashMap<>(rootScope.keyDefinition);
cascadeChildKeys(rootScope, res, "");
return new KeyScope(rootScope.id, rootScope.name, res, new ArrayList<>(rootScope.childScopes));
} | java |
private KeyScope resolveIntermediate(final KeyScope scope) {
final Map<String, KeyDef> keys = new HashMap<>(scope.keyDefinition);
for (final Map.Entry<String, KeyDef> e: scope.keyDefinition.entrySet()) {
final KeyDef res = resolveIntermediate(scope, e.getValue(), Collections.singletonList(e.... | java |
private DocumentFragment replaceContent(final DocumentFragment pushcontent) {
final NodeList children = pushcontent.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
final Node child = children.item(i);
switch (child.getNodeType()) {
case Node.ELEMENT_... | java |
private boolean needPushTerm() {
if (elementStack.empty()) {
return false;
}
if (elementStack.peek() instanceof TopicrefElement) {
// for dita files the indexterm has been moved to its <prolog>
// therefore we don't need to collect these terms again.
... | java |
public boolean matches(final Node node) {
if (node.getNodeType() == Node.ELEMENT_NODE) {
return matches(((Element) node).getAttribute(ATTRIBUTE_NAME_CLASS));
}
return false;
} | java |
@Override
public AbstractPipelineOutput execute(final AbstractPipelineInput input)
throws DITAOTException {
if (fileInfoFilter == null) {
fileInfoFilter = f -> f.format == null || f.format.equals(ATTR_FORMAT_VALUE_DITA) || f.format.equals(ATTR_FORMAT_VALUE_DITAMAP);
}
... | java |
private List<ResolveTask> collectProcessingTopics(final Collection<FileInfo> fis, final KeyScope rootScope, final Document doc) {
final List<ResolveTask> res = new ArrayList<>();
final FileInfo input = job.getFileInfo(fi -> fi.isInput).iterator().next();
res.add(new ResolveTask(rootScope, input,... | java |
private List<ResolveTask> removeDuplicateResolveTargets(List<ResolveTask> renames) {
return renames.stream()
.collect(Collectors.groupingBy(
rt -> rt.scope,
Collectors.toMap(
rt -> rt.in.uri,
... | java |
List<ResolveTask> adjustResourceRenames(final List<ResolveTask> renames) {
final Map<KeyScope, List<ResolveTask>> scopes = renames.stream().collect(Collectors.groupingBy(rt -> rt.scope));
final List<ResolveTask> res = new ArrayList<>();
for (final Map.Entry<KeyScope, List<ResolveTask>> group : ... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.